Semaphore Bot

Current Stats:
Tweets: 351
Followers: 8
Favorites: 5
Retweets: 20
The Semaphore Bot is a Twitter bot which responds to any tweet containing the word "semaphore" with an animated gif of a man spelling out the tweet contents via semaphore flags, (Example).

You can find the Semaphore Bot here.

Updates!

2012-01-31: The bot now responds with multiple phrases.

2012-01-31: Designer extraordinaire Molly Woodward has designed a custom set of semaphores for the semaphore bot!

How does it work?

The first step is to look for tweets that the bot is interesting in responding to. This is done using the Twitter Search API. To use it you issue a post to https://stream.twitter.com/1/statuses/filter.json with a post body of "track=term1,term2,...".

Once the tweet arrives (as json), it gets examined for a few criteria such as making sure that none of the terms it searched for are people's twitter names. The text of the tweet is extracted and the animated gif is created.

Semaphore flags use the same orientation for numbers and letters, with special control positions to indicate when the following signals will be alphabetical or numeric. For more about how semaphore flags work, see wikipedia. Following those rules of alphabetical and numerical changes, ImageMagick's convert function is used to string together the appropriate sequence of flag position into an animated gif.

Finally the newly created animated gif is uploaded to imgur using their api. A tweet response is prepared with the new imgur link, and off goes the tweet.

Some reviews






Next steps

- Perhaps showing the letter / number in each video frame would give people a better idea of what they were reading.
- Have some artists draw semaphore people for different themes.
- A bigger list of ways the bot responds.
- Make a little semaphore robot.