Facebook support for BarnOwl
by Edward Z. Yang
This one's for the MIT crowd. This morning, I finished my Facebook module for BarnOwl to my satisfaction (my satisfaction being asynchronous support for Facebook API calls, i.e. no more random freezing!) Getting it to run on Linerva was a bit involved, however, so here is the recipe.
- Setup a local CPAN installation using the instructions at sipb.mit.edu, using local::lib. Don’t forget to add the setup code to .bashrc.mine, not .bashrc, and then source them. Don't forget to follow prerequisites: otherwise, CPAN will give a lot of prompts.
- Install all of the CPAN dependencies you need. For the Facebook module, this means Facebook::Graph and AnyEvent::HTTP. I suggest using notest, since Any::Moose seems to fail a harmless test on Linerva. Facebook::Graph fails several tests, but don't worry about it since we'll be using a pre-packaged version. If you want to use other modules, you will need to install them in CPAN as well.
- Clone BarnOwl to a local directory (git clone git://github.com/ezyang/barnowl.git barnowl), ./autogen.sh, configure and make.
- Run using ./barnowl, and then type the command :facebook-auth and follow the instructions!
Postscript. I am really, really surprised that there is not a popular imperative language that has green threads and pre-emptive scheduling, allowing you to actually write code that looks blocking, although it uses an event loop under the hood. Maybe it’s because being safe while being pre-emptive is hard...
Known bugs. Read/write authentication bug has been fixed. We seem to be tickling some bugs in BarnOwl's event loop implementation, which is causing crashing on the order of day (making it tough to debug). Keep a backup instance of BarnOwl handy.
Did you enjoy this post? Please subscribe to my feed!