The Community Engine Blog
News, tools, and analysis for innovating in the information economy
« spam is automating the social without the social | | A Tag Based Learning Remix »
Veg-o-matic: An alpha web service using xFolk
“It slices, it dices ...” More specifically, this post presents an alpha release of a web service based on greasemonkey and reblog that identifies, validates, cleans, and republishes xFolk microformatted content. All comments are welcome.
Sections: Tools and Analytics
Topics: folksonomy greasemonkey microformats tagging webservices xFolk
I'm releasing a very alpha hack of an xFolk web service for this labor day weekend. Recall that xFolk is a microformat for representing the sort of social bookmark data you would find on a site like del.icio.us. A lot of people are republishing their links from such sites in their blogs. The advantage of using a microformat like xFolk for this sort of thing is that it makes it easier to write software to do something useful with the data.
The hack I am presenting here is a combination of a greasemonkey script and an alpha version of the reBlog refeed tool by eyebeam research and stamen design. The main action of interest is in the greasemonkey script that:
- Finds all instances of xFolk microformatted content in a page.
- Determines which of those instances are valid (i.e., contain all the required elements as indicated in the xFolk spec).
- Creats a clean clone of the xFolk entry that only contains elements specified in the spec.
- Uses an xml object to serialize the cleaned clone into a form element for republishing.
- Adds a script to the valid xFolk instances that makes it possible to republish their “cleaned” version via Mike Migurski's alpha rewrite of the reblog republishing tool released by eyebeam and stamen
I think the code itself will be helpful to other people writing javascripts to do useful things with microformats. I use a javascript object programming style to abstract away the main processing steps so that the strategy is apparent. The messy details are implemented in the methods. What emerges is a programming strategy that can be simply stated as “identify, validate, clean, do something”. The first three steps essentially move the microformat from markup convenience to data (albeit xml data which looks a lot like markup).
You can get the script here. To use the script you will need firefox and the latest release of greasemonkey 0.5. This is an alpha release, so I am not going to give novice level instructions for installing greasemonkey scripts.
You can see the script in action by going to these pages:
Click on the little chiclet next to the post title to republish just the microformatted content. Do not click OK on the alert dialog that asks if you want to edit the entry. That code is partially broken and presents an ugly although still somewhat usable page. You can see the results of your efforts here: http://thecommunityengine.com/veg-o-matic.
I'll keep this open as long as people do not do anything outrageous. I would appreciate any feedback. Much thanks to Mike Migurski for the reblog rewrite and help with the JSON javascript library.
Bud posted this on September 2, 2005
Trackback Pings
TrackBack URL for this entry:
http://thecommunityengine.com/cgi-sys/cgiwrap/fpgibson/thecommunityengine.com/mt/mt-tb.cgi/970