Friday, February 19, 2010

facebook chat on emesene 2

really experimental but it works (sort of)

the day that facebook announced support for jabber on facebook chat I made some changes on emesene 2 to make possibly to use emesene to chat on the facebook network. It wasn't so hard thanks to how awesome xmpp (jabber) is.

I added the possibility to parametrize host and port on preferences and now it's possible to chat through jabber on any server (that means, gtalk, facebook chat, jabber itself and I think AIM too).

the things that works:

  • log in
  • list contacts
  • chat

thins that work some time: status update of the contacts
things that don't work: all the others :D

I will try to bring the jabber support up to date.

to connect follow this guide: http://www.facebook.com/sitetour/chat.php

what are you listening?


I think the plugin that most people may use according to how many mails I get with that subject is the "current song" plugin.

So to start polishing the plugin system on emesene 2 I decided to implement the "music" plugin, that is like "current song" but on emesene 2.

you can see the code here:

http://github.com/marianoguerra/emesene/tree/master/mesinyer/plugins/music/

basically you have to create a file called handler_<your music player name here>.py and copy the content of handler_mpd.py replacing the body of the functions for the code required to do those actions on your preferred music player, after you finished that, change the last line:

songretriever.register('mpd', Handler())

by changing 'mpd' for the name of your player and then add a line at the bottom of the songretriever.py file to import your module.

and that's all!

please if you want to contribute a handler for this plugin use pylint on the file before sending it to me, code quality is one of the goals on emesene 2 :)