[uf-discuss] Mozilla Jetpack API and representative hCard add-on
info at csarven.ca
Wed Jun 3 09:54:31 PDT 2009
Using the Mozilla Jetpack API , I created a simple add-on that looks
for a representative hCard on the current Mozilla/Firefox tab and offers
a link to download it as a vCard . If you want to test it out, you
need to first install the Jetpack API, the Jetpack script, and head over
to a page with a representative hCard .
The way it works right now is that the script gets a hold of
'.vcard .uri.url[rel=me]' href value (If that's not accurate, please let
me know), and pass that onto Toby Inkster's representative hCard to
vCard transformer . The transformer actually grabs the representative
hCard of the input URI, which makes it a little redundant operation,
since we could simply pass on the current tab URI to the transformer.
Still with me?
What I'd really like to do is pass on only the representative hCard to
the transformer which outputs the vCard. I realize this is a grey area
between what the document can offer and what the parser can do with that
document, but, I know the latter is less of a concern.
So, I think there are some options which could make this fun extension a
bit better, but, I'd love to hear other possibilities.
* Passing the hCard object as a data: URI to the hCard to vCard
transformer using Brian Suda's X2V  (suggested by Tantek Çelik). This
however hits the HTTP GET length limit. Are there are any transformers
that can do this via HTTP POST?
* We can also output a copy of the representative hCard to a temporary
file on a server, then point the parser at the temporary file. Could use
a pastebin even (suggested by Toby Inkster). A little inconvenient, but,
* Probably the simplest solution that I can think of is to insert an @id
on the vCard node (if there isn't one already) on the fly with the
Jetpack script and send over the URI with a fragment identifier to the
transformer. The problem is that the '.vcard .uri.url[rel=me]' href
value might not be the same as the current URI + fragment identifier.
However, if I'm not mistaken '.vcard .uri.url[rel=me]' href value points
to the current URI as a representative hCard, so, it may be okay. Do you
see any issues with that?
All feedback more than welcome.
More information about the microformats-discuss