Enginursday: Monitor Twitter With a Raspberry Pi

How to create a Twitter monitor in Python and flash an LED using a Raspberry Pi.

If you were at Endgadget Expand in November (or perhaps follow the engineers on Twitter), you might have seen SparkFun’s booth. If you saw SparkFun’s booth, you might have seen an interesting display with several racing honey badgers. We affectionately named this “The Great American Tweet Race,” which you can follow on Twitter. The race is down right now, so there will not be much activity on Twitter. However, you can view the outcome of all the races from Endgadget Expand on its Twitter page.

The Great American Tweet Race

In The Great American Tweet Race, we used a Raspberry Pi to monitor the Twitterverse for Tweets containing specific hashtags. As each hashtag would appear, the honey badger corresponding to that hashtag would incrementally move along its track. The first honey badger to the end of the track would be declared the winner (unsurprisingly, the honey badger still did not care).

Several SparkFun engineers contributed to the creation of The Great American Tweet Race, and I was in charge of creating a Python script to monitor Twitter for specific hashtags. Whenever a Tweet appeared containing a hashtag of interest, the Python script displayed the Tweet on the monitor and made a call to some C code running in the background, which handled moving the honey badgers (calling C from Python is another topic for another day).

If you have ever been curious about how to connect to Twitter to monitor, search, and post Tweets, I created a tutorial to help you get started, which you can view here: https://learn.sparkfun.com/tutorials/raspberry-pi-twitter-monitor

Twitter LED

Granted, this simply blinks an LED whenever a Tweet appears with a specific hashtag, but think of all the possibilities! You would be well on your way to creating your own Twitter Race!

What fun projects have you seen or created using Twitter? Something that posts to Twitter? Or maybe something that searches Tweets?