Parsing microformats

31 January, 2007 (13:04) | firefox, microformats, operator

Update: This code is now contained in Microformats.js.

One of the things I’ve run into with Operator is learning how to parse microformats correctly. Instead of keeping the knowledge I’ve found to myself, I’ve decided to work with Andy Mitchell and create a generic cross browser microformat parser in JavaScript, tentatively called ufParser. That’s the reason I’ve been so quiet.

The parser allows for the creation of definition files for microformats, so that new microformats can be added to the parser easily. So far I have all of the Operator microformats done (hCard, hCalendar, hReview, hResume, geo, xFolk, rel-tag) and I have done XFN.

We’re also investigating the potential to create more generic actions as well (but I’ll maintain compatibility with old style Operator actions).

The next version of Operator will definitely use the new parser, so there might be some regressions here and there. Hopefully we’ll get them solved quickly

Stay tuned. I’m hoping to have something in the next week or so.

Comments

Pingback from John Resig - Microformats in Firefox 3
Date: January 31, 2007, 10:24 pm

[…] Thankfully, Michael has already started developing the solid Microformat Parser, with Andy Mitchell, that will go into Firefox 3. And since this is part of the overall Firefox 3 Content Handling Requirements, it’s a big priority for inclusion. […]

Comment from Raymond
Date: January 31, 2007, 11:44 pm

ufParser sounds really great.. Operator is sounding more and more like something that should go into firefox 3.. keep up the great work

Comment from Craig
Date: February 6, 2007, 2:38 pm

Seems like this concept has a lot of potential, once people know to put microformats in their web pages.

Question: Export Contact tries to export to Outlook, which I don’t have installed. Is there a way to make it export to Mozilla Thunderbird?

Comment from raju
Date: February 6, 2007, 6:30 pm

Mike, really a great tool. I’m thinking about integrating Microformats into the OpenLaszlo project. A Microformat parser running inside OpenLaszlo and exporting Microformats while a Flash movie or DHTML/AJAX app is running into the DOM.

I’ve two questions on that:

1) How does Operator register changes in the DOM tree structure? Would I need to explicitly signal Operator that there are new Microformats to pick up, if I generate them after the first parsing of the DOM?

2) Do you have any idea under what license the ufparser is going to be published? Any chance that the piece will be open source?

Thanks, keep up the excellent work.

Raju

Comment from mkaply
Date: February 7, 2007, 8:28 am

Craig:

It sounds like your system is configured to use outlook by default for vCards.

Bring up any folder (like My Documents) and select Tools->Folder Options.

Click on File Types.

Scroll down in Registered File Types and select VCF. Then select Change to change it to Thunderbird.

I’ll be changing this in the next release to bring up the traditional Open/Save As dialog vs sending it directly to the OS, so this change will be easier (determined by the browser)

Comment from mkaply
Date: February 7, 2007, 8:30 am

Raju:

1) You would need to signal Operator to pick up the new microformats and right now there is no way to do that. I’ll put that on my list for the next release. It will probably be an event you produce that operator picks up.

2) ufParser will be open source. Not sure of license right now. Operator is trilicensed, but ufParser might be something different depending on my lawyers.

Thanks!

Comment from Roger Costello
Date: February 8, 2007, 9:07 am

Hey Mike,

Great job with Operator!

Here’s a few things on my wish list for Operator:

1. Handle recurring hCalendar events. See my tutorial on this:

http://www.xfront.com/microformats/hCalendar_part2.html

2. Handle the hCalendar class property.

3. Handle the hCalendar status property.

/Roger

Comment from mkaply
Date: February 8, 2007, 9:55 am

Roger:

class and status are both parsed in the next version (what services they will be passed to is a different story)

I’m aware of the recurring issue and I am working on it.

Thanks!

Pingback from andreamartines.com » Webcards e Operator: i Microformat sono tra noi
Date: February 21, 2007, 1:50 am

[…] Attualmente entrambi i parser non sono in grado di rivelare e gestire microformat creati dinamicamente dopo il caricamento iniziale della pagina. Quindi sono più adatti a pagine di blog statiche che a web applications: ad esempio non sono in grado di rivelare i microformat nei tag del feed viewer del mio Excite MIX, perché sono generati tramite JS. Peggio ancora per applicazioni senza markup iniziale, interamente generate da javascript (come Netvibes). Dovrebbe però essere previsto un evento di ripetizione su richiesta del parsing per le prossime versioni di Operator, spero accessibile sia tramite script che tramite interfaccia. […]

Pingback from DOM Storage and Microformats
Date: March 1, 2007, 6:31 am

[…] Microformats Michael has already started developing the solid Microformat Parser, with Andy Mitchell, that will go into Firefox 3. And since this is part of the overall Firefox 3 Content Handling Requirements, it’s a big priority for inclusion. […]

Comment from Paul M. Watson
Date: August 9, 2007, 11:05 am

I had a look around but came up with nothing; is ufParser available as a separate library from Operator?

Thanks for the great work all the same.

Pingback from Javascript News » Blog Archive » Sumo! A Generic Microformats Parser For JavaScript
Date: September 6, 2007, 9:09 am

[…] files…It’s my best attempt at implementing a DSL in JavaScript. Unfortunately, I’ve just found this post ….it seems someone’s had a similar idea…damn. Oh well, it was a learning experience. […]

Pingback from microJSON - Microformats in JSON at notizBlog - a private weblog written by Matthias Pfefferle
Date: September 16, 2007, 5:08 am

[…] man Bedenkt dass viele gute Microformats Parser, wie z.B. der vom Firefox Addon Operator verwendete ufParser, auf JavaScript basiert. yigg itweb it wong it folk it link it bookmark […]

Pingback from Open Ideas Sharing » Blog Archive » Microformats bookmarklet or JS lib?
Date: November 9, 2007, 8:05 pm

[…] http://www.kaply.com/weblog/2007/01/31/parsing-microformats/ (seemed "opeator" bar already include a great javascript for that! Microformats.js.) […]

Write a comment