In my last post I introduced you to a project that I'd hacked together called #WittyLights, a very simple program designed to serve as an interface between the web (Twitter) and a local Arduino board. While I was generally happy with how everything had managed to come together, it felt extremely fragile and was prone to crashes if not interacted with in just the right manner. This is, of course, ignoring the most glaring problem with the entire setup: the program needs to be running locally at the time of a command in order to be able to catch it and respond to it. Given that I don't have a small, power-efficient computer with reliable access to the web, there's really no good way for me to solve this dilemma. But what if I ran the whole thing as a cloud app? Wouldn't that solve the latter problem?
I sat down and rewrote a good chunk of my application, hoping to fix a number of potential failure points in the code while also building in some new features. The end result is @WittyDevices, a Twitter account I built specifically for testing Twitter+Wit applications. For now it is setup to function in the exact same manner as #WittyLights, with the exception of that hashtag no longer being a requirement. Newly implemented is an automated reply from the system indicating whether or not the command was actually understood and then replying with the updated board map.
And the best part? It's all running in the cloud, 24 hours a day, ready for anyone to interact with. Well... except for when the server crashes. Anyway, here's where you can find the source code: