The “Hidden” Facebook Chat API June 11

A little over two months ago Facebook rolled-out it’s new integrated chat functionality.  My initial impression was “oh man, this is so awesome!”, but the novelty wore off after a few days.  Chatting inside a browser window is incredibly inconvenient; the flashing “New Message From [insert name here]” notification in the browser/tab title bar just isn’t enough to grab my attention when I’ve received a new message.  It’s a great concept, and a good way to keep in touch with the network that you’ve built, but I haven’t seen it get a lot of use since it was launched.  Every time I log into Facebook, I think to myself “if only there was a desktop client for FB chat…”.

It was brought to my attention today (thanks to a tweet by @ajvchuk) that the most recent beta version of Adium now supports Facebook chat.  Since then, I’ve discovered that Digsby added support almost a month ago.

Why is this so amazing you ask?  Well, because chat isn’t even included in the Facebook API!  I scoured the API documentation today looking for any mention of interacting with the chat system and came up empty handed.

It turns out that coderrr, a freelance Rails developer that apparently has no last name (it appears that he goes only by “Steve”), took it upon himself to “look under the hood at how its [the Facebook chat] protocol works”.  Steve discovered that it uses a combination of Comet and JSON for receiving messages and a simple POST for sending them.  He whipped up a quick proof-of-concept in Ruby and documented the findings on his blog.

I’m not sure how Digsby approached implementing Facebook chat (it was announced a few days before Steve’s blog post), but Adium took the work that he did and put it to use.  In good form, Adium developer Evan Schoenberg gave Steve credit for his discovery.

I don’t know about everyone else, but I think I’ll be using Facebook chat a lot more often now.  If only there was a way to completely disable the browser version of it…