Last Updated: February 25, 2016
·
6.185K
· davidgomes

Using Facebook Chat in Emacs

Picture
The other day I noticed that I am somewhat dependent on Facebook Chat for University projects. As so, I need to check what's up with my colleagues every now and then. Having to open Facebook for that is not very convenient, and even though I could use iMessages or another chat app, I prefer to never leave Emacs, my true Operating System.

As so, I found out about jabber.el - an XMPP client for Emacs. As so, I configured Emacs to connect to my Facebook account.

;; Define a list of my jabber.el accounts
(setq jabber-account-list '(
                            ("account_name_or_id@chat.facebook.com"
                             (:network-server . "chat.facebook.com")
                             (:connection-type . starttls)
                             (:port . 5222)
                             (:password . "your_password"))))

;; Disable jabber.el presence notifications
(remove-hook 'jabber-alert-presence-hooks
             'sr-jabber-alert-presence-func)

;; Connect to all my jabber.el accounts on startup
(jabber-connect-all)

The account_name_or_id defined above is simply your Facebook Account ID, which you can either be a custom string or a default number, just look it up on your Facebook Settings.

You can use jabber.el for Google Talk and other XMPP-based chat services. However, you should be loading your password string from a hidden file and not in your init.el.

That should be all you need to have Emacs connect to Facebook on startup. However, as I'm on OS X I had to add the following before all that:

;; Define location of gnutls-cli on OS X, instaled via brew
(setq starttls-use-gnutls t
      starttls-gnutls-program "/usr/local/bin/gnutls-cli"
      starttls-extra-arguments nil)

Basically, it seems that gnutls-cli is installed somewhere jabber.el is not expecting, if installed with brew.

Picture

3 Responses
Add your response

lool my VIM fanatic colleagues will hate that :-)

over 1 year ago ·

Does that still work for you? I'm getting not-authorized back from the Facebook servers, even though my credentials are right. Did they drop XMPP support for good?

over 1 year ago ·

Facebook has, unfortunately, dropped XMPP support for good...

over 1 year ago ·