To use the bookmarklet, drag the link below on to your bookmark toolbar:
Originally I had intended for the entire logic behind the Microformats overlay to be within the bookmarklet. However, it’s particularly difficult to get all the code on one line, and this more simplistic bookmarklet means upgrades will take automatic effect.
The bookmarklet has been primarily been designed for Safari, as Firefox has Tails. However, the Microformats Bookmarklet supports Safari, Firefox and IE (both 6 and 7).
To save an individual item, click on the item heading and it will automatically (if you’re using Safari) save the .vcf or .ics files and import them in to Address Book or iCal.
If you are saving your vcard or vevent in IE, it will prompt you to save an HTML file - make sure that when you save, you name it appropriately so that you can import it properly.
To close the overlay, click anywhere outside of the window (i.e. in the darkened area).
If anyone is interested, here’s roughly what is happening behind the scenes for the bookmarklet to work:
- Load external module: jQuery†.
- Load second external module: microformats.js (the main module).
- Apply a new inline CSS styles (because IE doesn't support CSS style sheet injection).
- Load the new HTML for the overlay.
- Search for vCard and vCalendar classes and capture all the information according to the guidelines laid out by Microformats††.
† Because jQuery saves so much coding time, and it’s a superb library to use.
†† The bookmarklet currently only supports hCards and hCalendars, but should be straight forward to support more formats where appropriate.
A lot of cross site testing took place for this bookmarklet, so I do know of a few places it doesn’t work.
I’ve seen a problem where the overlay simply doesn’t appear. I think this may be due to the site also using Prototype (since I’m using jQuery which may be conflicting). I have only seen this occur on Multipack members page.
Since hCards and hCalendars are defined using classes, a page with a lot of markup can take a number of seconds to parse all the information.
I have tried to parse all the different fields in the hCards and hCalendars, but I may have missed a few, particularly in the hCard. All sites I tested had all the information correctly imported.