22
Jan
09

Back into the swing of things

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!


19 Responses to “Back into the swing of things”


  1. 1 Stemp January 22, 2009 at 2:19 am

    If you’re still using Ubuntu, maybe you could try the webkit-team PPA for latest webkit build ?

    https://launchpad.net/~webkit-team/+archive

  2. 2 Vadim P. January 22, 2009 at 2:48 am

    How does github compare to launchpad, if you’ve used both?

  3. 3 Eetu January 22, 2009 at 3:15 am

    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.

  4. 4 Zeeshan Ali January 22, 2009 at 3:25 am

    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).

  5. 5 grigio January 22, 2009 at 3:47 am

    Cool! It would be nice to have a webnotification icon (webservice agnostic) to switch on/off

  6. 6 Andrea Cimitan January 22, 2009 at 4:36 am
  7. 7 Enver ALTIN January 22, 2009 at 6:07 am

    Please make it a gnome-do plugin :) Or, maybe I should?

  8. 8 Dylan McCall January 22, 2009 at 6:22 am

    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?

  9. 9 nemolivier January 22, 2009 at 7:37 am

    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/

  10. 10 John Stowers January 22, 2009 at 11:50 am

    @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

  11. 11 nemolivier January 22, 2009 at 9:23 pm

    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.

  12. 12 John Stowers January 22, 2009 at 10:19 pm

    @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

  13. 13 John Stowers January 22, 2009 at 10:33 pm

    @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

  14. 14 nemolivier January 23, 2009 at 1:23 am

    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.

  15. 15 John Stowers January 23, 2009 at 10:21 am

    @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.

  16. 16 John Stowers January 23, 2009 at 1:05 pm

    @all: I just pushed a fix that should stop the segfault. Can you please test again?

  17. 17 nemolivier January 23, 2009 at 11:27 pm

    ok, work great this morning ! I now have it running.
    Thank’s a lot.

  18. 18 sakuramboo March 12, 2009 at 3:16 pm

    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.

  1. 1 » Some More Software Johns Blog Pingback on Jan 23rd, 2009 at 5:10 pm

Leave a Reply