Weekend project: A ruby application to pass new tweets to libnotify in Ubuntu

I was thinking on Saturday morning that it would be nice to have a way to receive ongoing notifications of new tweets while I’m running linux, without having to check my phone, switch to a browser or twitter application, or stop doing whatever it is I’m doing. My first thought was to create a bash script to work in conjunction with twidge, filter out the data, and pass it to libnotify via the command line, but it started to get a little more complex than I was intending. I had wanted the script to be simple, and twidge’s output wasn’t working with me. I decided instead to start over, using ruby to accomplish the same goal: Twitter notifications over libnotify.

This new effort was helped out tremendously by the existence of two ruby gems: twitter and libnotify. The twitter gem is obviously a wrapper for the twitter API for ruby, whereas the libnotify gem is a working interface for the linux libnotify package. These helped me get the base functionality working within an hour, and the remaining done by the end of the day Saturday.

My intent was to spend as little time on the project as possible–just enough to get notifications for myself–therefore it goes without saying that I spent a number of extra hours trying to add additional functionality, realizing that functionality would require more time than I was willing to spend, then reverting back to the original (and working) functionality.

It’s a simple program with a simple purpose, and it has already proved useful to me (it’s running right now, and has been permanently added to my start-up scripts). Try for yourself here.

Leave a Reply