[microformats-discuss] A 10 line script to identify and process any microformat

Bud Gibson bud at thecommunityengine.com
Fri Jul 29 05:13:27 PDT 2005


On Jul 29, 2005, at 0:57, Mark Rickerby wrote:


> Identification is fairly straightforward, as these GM scripts have
> demonstrated. But what's involved in processing? You need to parse the
> information into a data structure, and then do something with that
> data structure, which would probably take a lot more than 3-4 lines of
> javascript, not to mention the design/creativity involved in doing
> something useful with the data. But therein lies the potential...
>
>

Mark (and others who may wish to join in):

Thanks for the recommendation regarding script requests.  Aside from  
some (in my opinion) minor corner cases, I agree that GM cracks the  
identification issue nicely, and I would like to see more people  
adopt the approaches shown in my script and Alf's more developed  
examples (there's a great one here: http://hublog.hubmed.org/files/ 
hreviewextractor.user.js that does essentially the same thing for  
hReview that Hotelling does for hCard but with a lot less code  
devoted to identification).

As for needing to parse the microformat into data structures, the  
proof is in the pudding there.  You could just continue to use XPath,  
and that might even be desirable given the semistructured nature of  
microformats.  There are also some times where you may be better off  
doing the heavy processing on a server.  All of these topics might be  
better discussed in another forum, I just raise them.

A couple of questions for any of you that I would be happy to  
continue off-list if appropriate:

1.  Would you be willing to make a special area on the wiki for  
microformat-oriented scripts?  That might be a real help for people  
trying to figure out how to script microformats.  Also, as I mention  
in my blog post concerning this little script,  MF and GM seem to go  
hand-in-hand.

2.  Do you have any ideas for how to promote learning to hack  
microformats?  I posted my script here and kept it super simple for  
didactic purposes.  I could see posting a whole set of hack-like  
tutorials.

Bud



More information about the microformats-discuss mailing list