I was able to use facebook chat with an external application using the following information:
First, find your Facebook username by going to http://www.facebook.com/your_user/. Next, Open iChat, then select iChat » Preferences and click on the Accounts tab.
Click on the + (plus) sign to add a new account, with these settings:
* Account Type is Jabber Account * Account name is firstname.lastname@example.org, and enter
your password * Click the drop-down arrow to reveal Server options. Enter chat.facebook.com as the server name. * Enter 5222 as the port and click Done.
Click Done again, and you are good to go.
From reading this, it seems that it might be possible to telnet into facebook chat. I tried, but wasn't able to. Is it possible? How?