hKit and Tidying (X)HTML: A Serious Failure [Update]

Posted on March 6th, 2008

After promoting hAvatar during BarcampBrighton and SemanticCamp, I was starting to get pretty happy with the response we got from people. So, you can imagine how annoyed I was when suddenly my own avatar stopped working on several sites. Today I took a dive into the code behind the hAvatar plugin for Wordpress, and most importantly: hKit.

Problem Found

As I expected the issue was not with Alper’s code of the hAvatar plugin but rather with the hKit PHP library. As a step in the process of determining the hCard in the hKit library, the source code that is read is “Tidied”. hKit has 3 build in ways of doing this, the default being using the W3C tidy service.

The W3C service is a very simple service that simply takes a URL as a parameter like this:

http://cgi.w3.org/cgi-bin/tidy?docAddr=http://google.com/

As a result this gives the tidied output of the source of that URL. Now the serious issue that I ran into was that for some weird reason my URL (http://cristianobetta.com) causes a timeout in this service. To be more precise: about every URL on my server causes an issues. Obviously I contacted my hosting provider about this issue but let’s put the problem in a different perspective.

The Bottleneck Dillema

The problem here in my opinion is that hKit relies on a “bottleneck” in their process. Normally this bottleneck only causes a performance issue, but this time it even caused errors. Sadly though, because of this use hKit is not really a standalone script and things can therefore go wrong without hKit knowing. In my opinion hKit would be much more interesting if it shipped with an in-build, platform independent solution to take care of this step.

There are currently some other options besides the proxy to tidy up code. One of the settings of hKit allows for changing the tidy mode to “exec”, “php” or “none”. The first tries to use the tidy command, the second the tidy php functions. Unfortunately none of both are by default available on most systems, making an easy deployment of hAvatar on those systems way harder. To use the “php” option the tidy library needs to be compiled into PHP, which is sometimes impossible, and to use the “exec” command a binary is needed, which makes the solution rather platform dependent.

The Plead

So here I am, asking for a new solution that makes hKit a more independent library. I think it makes sense from a technical and philosophical perspective, but most of all from a performance view. Currently hKit isn’t that fast already (you can’t instance it more than once, making parallel processing of avatars fairly hard) and I think that a server side, non-proxy solution would seriously give this kit a performance boost. Obviously I would be happy as people would by default probably be able to load my avatar, as where it is currently unclear why W3C can’t fetch my url.

* Update: After an email with my hosting provider it seems that the W3C proxy now has access to my server, enabling all hAvatar activities on my domains. Still, I think my point above is valid from a performance point of view.

SemanticCamp

Posted on February 19th, 2008

So last weekend I went to SemanticCamp, a semantic BarCamp organized by Tom Morris here in London at Imperial College. The event was kind of “OK”. I said OK because honestly the event was not the best thing for me. I personally went because I was wondering what all this “semantic” stuff was all about. I guess more people had the same idea, and as a result, at most of the times, only 1 talk was going on. Combine this with a lot of no-shows and you get bored soon. I didn’t feel like listening to too many talks on RDF so I hung around with some people in the other rooms instead.

SemanticCamp - Day 2 - Semantopoly

There were some great things about SemanticCamp though, most important of which was the organization, the location, and the drinks afterwords. One of the other great things about SemanticCamp was the Semantopoly game, custom made by Jon Linklater-Johnson. The game is a kind of Monopoly where you can play a web “celebrity” and buy technologies and social networks to make mashups and get venture capital. One of the board characters was Jeremy Keith so image the joy we had when Jeremy decided to play himself in the game.

Here are the photos:

hAvatar FTW!

Posted on February 9th, 2008

hAvatar Example

If you ever read the comments here, you might have noticed the avatars that show up with some people. These are not Gravatars or MyBlogLog avatars, no they are avatars personally hosted by those commenters on their own site. What drives this mechanism? The plugin is called hAvatar and the technology involves Microformats.

hAvatar is build by Alper and what it does is simple: it fetches the URL you use in the comment (either your OpenID or other URL) and sees if you have a hCard on that page. A hCard is a Microformat and is nothing more than some extra semantics added to your page that represents you business-card. In the very literal sense, a hCard is the Microformat equivalent of the vCard format.

Now, if your hCard has a photo attached to it, the hAvatar plugin will take that URL, wrap it in a tag and return it to the template. All you then need to do is call the hAvatar call somewhere in your comments loop, and boom you have an open-standards-defined avatar system on your blog!

Download it here and take a look at my front page for an example of an hCard with an attached photo. People using the plugin at the moment include MissGeeky, TheBleacher, and obviously Alper and I.

Google Homepage With Style

Posted on March 22nd, 2007

Since yesterday I noticed that the Personalized Google Homepage now supports style. It looks funny but I do miss some manly themes.

Google Homepage Style

Nice New Microformats BookMarklet

Posted on March 1st, 2007

Thanks to Simon Willison for pointing out this nice bookmarklet for Safari and Firefox that creates a far better interface for browsing Microformats. In contrast to the bookmarklets in my previous post this bookmarklet allows you to browse multiple Microformats in a nice javascript overlay. Combine this with the special stylesheet in Safari to make browsing Microformats very easy.

Microformats

© Cristiano on Tech/Life • Powered by Wordpress • Themed based loosely on the Swiss Cool theme.