Friday, August 6, 2010

The Facebook Markup Language

A couple of weeks ago I decided to update my website and use HTML5 markup for it. I have no specific reason for this choice except from my curiosity which wants to find out what HTML5 is (or will be) capable of.

Another value that I wanted to add to my homepage is semantics. The 'Semantic Web' has been described as an important component of Web 3.0. Web 3.0 is also many other things (it even has different definitions for other people). The important thing about semantics is that it tries to link content over the internet in a huge graph. Many attempts have been done to do this efficiently (for instance RDF), but they all are different from each other in many ways. This is why it was hard for me to decide what method was best for my site.

Then I remembered that Facebook consumes a semantic protocol named Open Graph. Facebook is quite popular and innovative. I use Facebook myself, as do many people that I know. Therefore I dug deeper into the Facebook API to find out what I could use to make my website better, regarding semantics.

It didn't take long to learn how Facebook can be integrated in other websites. I won't describe this completely because everything is very straight forward and the API has excellent docs which can be found on the Facebook Developer website.

As one can see Facebook uses its own markup language (X)FBML which can be embedded in XHTML (because it is an XML subset). The FBML tags are then transformed to XHTML tags (mostly iframes) via a client-side ECMA script (aka javascript) so they become useful to modern browsers.

1 comment:

  1. Are you still using this to get XFBML in HTML5? Is there no official solution from Facebook? The JavaScript SDK still has the method to parse XFBML, but Their documentation doesn't mention anything about how to get that to work with HTML5.

    ReplyDelete