Techcrunch today talked about a new “Like Button for the Whole Internet” which Facebook looks to be launching some time soon, and has been tested amongst several developers as they’ve been told. What they didn’t mention is that you can access the code for this right now in the code to the latest open source Javascript SDK. While it does not currently work in its current form, it is open for the entire public to see, and has been there for the last few months (along with a few other hints I’ll let you find).
Assuming the source of the new SDK (currently in alpha) remains the same, the XFBML button can be placed on any website on the internet, and it increments the number of likes when a user clicks on it. By default it increments the likes for the current page, but there appears to also be the ability to specify a “permalink” attribute, along with a URL to another page. It’s unclear if that will be changeable in the XFBML tag or not. Also, a required “node_type” attribute that defaults to “page” can be set. Lastly, an optional “page_url” can be set. The XFBML tag loads content from /widgets/like.php (attributes of the XFBML tag get passed as attributes in the URL). That URL appears to be disabled at the moment.
So it looks like the XFBML tag will look something like the following, and it will be part of Facebook’s widgets architecture:
Also of interest, Facebook has an entire tag library devoted to the new tag, like.js. You can probably gain a little more info from that. I can’t wait for them to turn on like.php so we can play with this.
My book, FBML Essentials, may just get a lot more interesting as Facebook prepares for their “OpenGraph API”, enabling any website to become its own Facebook Fan Page across the internet. This is one of many tags I’ve seen that are very interesting – see if you can look through the code and find anything else that looks interesting like this. I love being a developer. 🙂