Announcing Botomatic.com - Build Your Own Twitter Bot
What is Botomatic.com?
Last night I rolled out a new service (in Alpha) called Botomatic, which aims to make it easy to build Twitter bots. This project started almost two weeks ago at the Microsoft MVP Global Summit, where I gave a talk about Windows Azure in which we built a simple Twitter bot: @anonomatic. A few people followed up and asked if they could use the service to drive their own Twitter bots, so I generalized what we did and released it as a service. This is the second serious project I’ve rolled out on Windows Azure (the first being this blog).
Below you can see a screenshot of the rules building UI. These rules are the entirety of @anonomatic (http://botomatic.com/bots/anonomatic):
Notice that for every Twitter event, one of the available actions is to post the event to a web application, where you can host complex logic. Using that feature, I built a more interesting bot called @deliciomatic (http://botomatic.com/bots/deliciomatic):
Deliciomatic collects the links you tweet and posts them as bookmarks to your del.icio.us account, converting hashtags to del.icio.us tags. It uses nearly all the features of Botomatic, and the logic of the bot is mostly contained in a simple web app I hosted using AppJet. You can view the source for the deliciomatic AppJet app at http://source.deliciomatic.appjet.net.
Technology
Botomatic runs in Windows Azure and consists of a web role and a worker role. The web role is using ASP.NET MVC RC2 and jQuery. It uses forms authentication directly against your bot’s Twitter credentials, stored in a Windows Azure table. The worker role loops forever, processing the bots in turn. I’m using queues as a simple locking (leasing, really) mechanism to avoid processing the same bot from multiple worker role instances at the same time.
In future blog posts, I hope to drill into the queue usage in this application. The data and concurrency issues were the most interesting challenge in building Botomatic in a scalable way.
What’s Next?
Please give Botomatic a try for me. I’m using GetSatisfaction, so you’ll see that familiar “Feedback” link on the side of the site. Press it often and tell me what you think. :-)
P.S. Next week is MIX! You might imagine (HINT HINT) that I’m going to build some cool Twitter-related stuff in my session there.