Microformats
I've just marked up my little bio on the right hand side there with some subtle microformats. You may notice the vCard link which uses technorati to parse the HTML and returns a vCard, you can also use browser plugins to like Tails to extract the data and do what you want with it (bluetooth it to a phone, like Jeremy demoed at BarCamp).
Next I wanted to markup the names and urls of commenters on my blog, (no real reason). But I quickly hit a wall, blogger templates! I don't know why I'm still using this system, I keep promising myself I'll migrate to something better. Anyway I decided to spend a few minutes seeing if I could hack it to do what I want. The problem is that the blogger template has a single tag that is replaced with the link, <$BlogCommentAuthor$> turns into something like <a href="http://example.com" rel="nofollow">Joe Bloggs</a>
My awful awful hack goes something like this, <a class="fn url" junk=<a href="http://example.com" rel="nofollow">Joe Bloggs</a> . Now this is of course totally invalid XHTML, there are no quotes around an attribute and the chevron isn't encoded. But it works! Except when I try to use technorati to parse a vCard, but Tails works fine, if I'm lucky it might be something other than the hack causing it.
I've noticed a problem though, I allow anonymous posts, which appear as spans instead of links, so you get something like <a class="fn url" junk=<span class="anon">Anonymous</span> so then I have to add a closing anchor after, and we end up with an anchor with no href. Maybe I should just ban anonymous postings!
Next I wanted to markup the names and urls of commenters on my blog, (no real reason). But I quickly hit a wall, blogger templates! I don't know why I'm still using this system, I keep promising myself I'll migrate to something better. Anyway I decided to spend a few minutes seeing if I could hack it to do what I want. The problem is that the blogger template has a single tag that is replaced with the link, <$BlogCommentAuthor$> turns into something like <a href="http://example.com" rel="nofollow">Joe Bloggs</a>
My awful awful hack goes something like this, <a class="fn url" junk=<a href="http://example.com" rel="nofollow">Joe Bloggs</a> . Now this is of course totally invalid XHTML, there are no quotes around an attribute and the chevron isn't encoded. But it works! Except when I try to use technorati to parse a vCard, but Tails works fine, if I'm lucky it might be something other than the hack causing it.
I've noticed a problem though, I allow anonymous posts, which appear as spans instead of links, so you get something like <a class="fn url" junk=<span class="anon">Anonymous</span> so then I have to add a closing anchor after, and we end up with an anchor with no href. Maybe I should just ban anonymous postings!
Labels: blogger, hack, microformats


Comment Feed

