[uf-dev] The Microformat Test Suite

Michael MD mdagn at spraci.com
Fri Jan 12 11:13:09 PST 2007


>
> I have a swift little Ruby microformat parser which is not nearly
> complete.  It's Good Enough for my purposes, but I need to know it can
> work for other people and that the data structures I'm building are
> proper.
>
> So, the unit tests.  I brought this up to Ryan King offlist and he
> pointed out that the hreview specs in the test suite all have
> corresponding JSON files.  Which makes it really easy to get going,
> but the problem is the other formats don't yet have JSON files -- the
> hCard specs have vCards, hCalendar iCal, etc.
>
> I'd love to help out by submitting JSON'd versions of specs.  It is
> significantly simpler (and more reliable) for me (and probably most
> developers) to parse JSON in Ruby than to write my own probably-sucks
> vCard parser.
>
> What I'd like to know is how other parser authors have been dealing
> with testing against the official repository and if the intention is
> to provide .json for all the specs (living alongside the vCards and
> iCals, I imagine, not replacing them).

I have been thinking for a while it would be nice to have a central 
repository somewhere on the wiki for data structures to represent 
microformats.

I've been making various attempts at doing perl and php parsers (my own 
'probably sucks' code - usually for specific purposes related to event 
listings - so mostly hCalendar with a bit of hCard so far - with 
"liberalness" being very important as its user-created and "out there" 
content I'm dealing with)
...and was thinking that for future reusability representing as much as I 
can of microformat specs in some kind of hash or associative array would be 
a good idea.
(but have no idea if I started going about things the "right" way with the 
hash representations I started to create in perl - probably not...... for 
speed I want to re-arrange them some way so I can avoid having to loop 
through or recurse into them where possible).

JSON is probably a good choice for such a shared resource because there are 
JSON parsers for lots of languages.









More information about the microformats-dev mailing list