Sunday, September 13, 2009

Facebook Notifier

OK, I've become hopelessly addicted to Facebook ... I admit it.

Last night, with the rain pouring outside and the US Open tennis matches postponed, I decided to write something that I've wanted for a long time. An application that sits in the Windows System Tray and notifies me when I get a new Facebook notification. By "notification", I am referring to the red balloon with the number '4':

By having this, I don't have to constantly surf over to the Facebook homepage in order to check my activity.

Luckily, there is a .NET Toolkit for Facebook here. Using this toolkit, it only took me about two hours from start to finish to complete my notifier. I spent another hour cleaning up the code and parameterizing some of the hard-coded things like my user ID, my application's secret codes, and the stuff around the playing of the notification sound.

I found that I had to resort to FQL (which is the SQL-like query facility that Facebook provides) to properly retrieve the state of my Facebook notifications. The function that the Facebook Toolkit gave me always told me that I had no notifications.

I also added the ability to pump in my own notifications for testing purposes.

This application is just for me, and I do not think that I will be releasing it. If I really wanted to do something serious, I would create a general-purpose notifier toolkit that is able to work over Facebook, GMail, Yahoo Mail, etc. Each of these services would have its own "input adapter" as part of the notification framework. And, I would probably integrate this with some sort of CEP engine so that alerts could be sent to a Facebook account.

Maybe one day in the future .....

©2009 Marc Adler - All Rights Reserved.
All opinions here are personal, and have no relation to my employer.


Francis Shanahan said...

You can just get an RSS Feed of your notifications, not sure if you were aware of that feature.

mf said...

I've been looking for a simple bare metal tray app that only shows notifications and nothing more since Facebook relocated the notifications to the top left of the page which is generally blocked off by other applications I have running. Rather than duplicate your efforts I'm interested to see what you've made, if possible. What's out there is generally part of some desktop widget set (probably with its share of unsolicited advertising), whereas I really just need notification balloons that will open links in my browser.