It has been a long time between posts, but I am back in New Zealand now, and vowing to get back on top of this blogging thing. I will post more in the coming weeks about my time in France with the ENAC crew, but I will start today small; by releasing some code I have been hacking on.
I wanted a small project to get back into the desktop development mindset after being in the embedded C (ARM 7 LPC2148) and OpenEmbedded (Beagleboard and Gumsix Overo) world for a while. I am also ecstatic that git was clearly the most popular DVCS in the recent survey, I really hope it provides the impetus for GNOME to move to a DVCS.
With that in mind I decided to use this small project to learn git. Firstly, github.com is the coolest thing I have ever seen. I am moving all of my projects (except Conduit) there, and using the pages and wiki features to document them as appropriate.
Facebook Notify
Facebook Notify is a small PyGtk application which monitors your Facebook profile and notifies you when it changes. Some would consider it a gross abuse of the GNOME notification area, but it keeps me out of the web browser, decreasing procrastination, thereby improving my productivity.


It notifies you when any of the following events occur;
- One of your friends changes their status, profile picture, or profile details
- You receive a friend request, event or group invitation
- Someone writes on one of your friends walls
- One of your friends is tagged in a photo
The code is a few days work, and nothing impressive. It does however contain a rather nifty deferred threaded network io system so to never block the GUI. I guess something similar could be done in C + libsoup + GTask, if one was allowed to arbitarily chain callback functions. I remeber seeing a bug and discussion about this somewhere.
The main bug is that WebKitGtk segfaults if you destroy the WebView after logging into Facebook. Not cool. Anyone know anything about this bug? Is anyone going to make an updated libwebkitgtk release soon?
So, please, fork my code. That way I have a real life example to practice merging from!

If you’re still using Ubuntu, maybe you could try the webkit-team PPA for latest webkit build ?
https://launchpad.net/~webkit-team/+archive
How does github compare to launchpad, if you’ve used both?
Why not use Gwibber? Ok, it only has real Facebook support for status updates, but you can subscribe to a RSS which contains other kinds of notifications.
After i get authenticated, i only see this:
emit
Calling auth.getSession… finished
Calling fql.query… finished
-> got my details
Calling notifications.get… finished
-> notification changes detected
Downloading http://profile.ak.facebook.com/profile5/1588/102/q580470081_404.jpg...
finished
and then i never get any notifications ever (yes, i have made sure that there were some events like new friend requests).
Cool! It would be nice to have a webnotification icon (webservice agnostic) to switch on/off
Please use tango icons!
http://pidgin-facebookchat.googlecode.com/files/facebook_icons.zip
Please make it a gnome-do plugin
Or, maybe I should?
Looks cool, although a bit large for a tiny notifier app. Would be nice if it only appeared in the notification area when it was needed (if only we had a user friendly list of running applications so it didn’t need to be a permanent fixture there).
Maybe a bit out of place, but I wonder if this type of stuff could be done with a Telepathy connection manager?
Nice idear… but I can’t use it here (ubuntu 64, awesome WM, and gnome-session running)
The icon apear in the notification area, but nothing where to put my login / password, and the info-ballon say « trying to connect to facebook » !
Must-I use a text file as configuration file ?
Left clic give me a « connect » that I can’t clic.
Right clic give me « about » and « quit ».
What about adding this to the pidgin-facebook¹ plugin ? (or maybee them looking at your code ;o)).
Thank’s a lot,
Olivier.
[1] http://code.google.com/p/pidgin-facebookchat/
@Stemp: I have tried both versions, still crashes. See http://code.google.com/p/pywebkitgtk/issues/detail?id=23
@Vadium: The pages feature is excellent, and wikis, makes it a single place for project hosting. The interface is a lot simpler (launchpad menu structure is too deep). Things like fork-queue and watchers is intuitive - no need to manually sign up for a common team and nominate branches for merge like LP. The site is faster to load. Commits graphs are nicer. Can track a users activity on all branches from their profile. The source browser is better - LP loggerhead bzr code browser is terribly slow and unattractive. Etc etc
@Eetu: I dont like that whole microblogging business, and I felt like writing my own using only the Facebook API, which I presume to be more stable than their RSS feeds
@Zeeshan: Do you get additonal messages posted after that? i.e. every minute you should get Calling fql.query… finished. If this does not happen every minute then its a bug. It works by noticing changes in subsequent fql.query results for a number of differenct queries.
@Andrea: Thanks, I have commited the new icons.
@nemolivier: If it cannot get passed “trying to connect to facebook” it might be a connectivity problem. Are you behind a proxy?. Once it has connected to facebook, click on the notification icon, a menu should pop up and allow you to click “Connect”, which will then load a web browser to let you log in
Thank’s for the answer.
I’m not behind a proxy and all my web services seems to run smoothly (pidgin, ffx, dropbox, torents…).
I launch it from my terminal and here is the output : http://pastebin.com/m4ab40519
NémOlivier.
@nemoliver: Weird - Thats a bug in pyfacebook (the bindings to the facebook API I am using). Please see http://code.google.com/p/pyfacebook/issues/detail?id=106 and let me know if removing python-json and replacing it with python-simplejson works
@nemoliver, zeeshan: I just pushed a fix that should improve the robustness of the python facebook api library to different json parsing libraries [1] that might be present on your system.
[1] You may have one or more of Python 2.6 json, python-simplejson, python-jsonlib, python-json, python-json-py, or django
Hello John,
The last code run better… but
:
The applet launch, I can clic on « connect », a new ffx windows open, I log into my facebook count and autorize the application. The a « you can close this windows » appear. When I close it, the applet quit segfault : http://bepo.pastebin.com/m4b3e25d7
Looking into synaptic I have both json and simplejson (this last one depend on python 2.6). They both are the ubuntu-universe.
Thank’s a lot for taking time on this.
@nemoliver:
This is a crash in webkit. I get a similar sequence of messages, but no segfault
facebook parsing using: XML (N/A)
Calling auth.createToken… finished
** Message: NP_Initialize
** Message: NP_Initialize succeeded
** Message: NP_Initialize
** Message: NP_Initialize succeeded
** Message: NP_Initialize
** Message: NP_Initialize succeeded
** Message: NP_Initialize
** Message: NP_Initialize succeeded
Calling auth.getSession… finished
I’m not really sure what the root cause is - I can reliably trigger the crash by destroying the window. I work around it by just hiding it. On your setup this does not appear to be enough. I would suggest reporting the bug into the webkit (http://webkit.org/quality/reporting.html), pywebkit (http://code.google.com/p/pywebkitgtk/) and distribution bug trackers.
Sorry I cannot be more help.
@all: I just pushed a fix that should stop the segfault. Can you please test again?
ok, work great this morning ! I now have it running.
Thank’s a lot.
Upon closing the login window, I get…
Calling auth.getSession… finished
Calling fql.query… finished
-> got my details
Calling notifications.get… finished
-> notification changes detected
Downloading …
finished
And then it becomes non-responsive.