Friday, May 9, 2014

Boris, the Twitter Dino-Bot

UK teachers: want two days of free, top-class CPD? Check out Picademy, and send us your applications!

What do you get if you cross a PiFace with a rubber dinosaur from Marks and Spencer?

Twitter magic, that’s what.

Teacher Dan Aldred has come up with a thing of beauty: a hack that makes your desktop dinosaur roar whenever it’s mentioned on Twitter. (What do you mean, you don’t have a desktop dinosaur?)

Boris, scaring the living bejezus out of all comers.

Boris, scaring the living bejezus out of all comers.

The build itself is simple enough – you can do the same with any kids’ toy that uses a button or switch to make a noise. Dan built a bridge across Boris’s switch using tin foil, our favourite hacker tool. He hooked Boris up to the PiFace GPIO expansion board (the PiFace site is currently the only site on the internet that features a picture of me crouching like a preying mantis in a cardigan on its front page), got Python talking to the Twitter API and wrote a simple program to tell Boris to roar whenever the string “ROAR” is tweeted at Dan’s account. All very easy, but the results are magic.

Boris, innards exposed.

Boris, innards exposed.

Here’s Boris in action:

You can send Dan a tweet yourself – he’s @Dan_Aldred. (Just think! If enough of you tweet “Roar” at him, he’ll either be driven mad or forced to power Boris down.) We love it, Dan. Boris is a thing of beauty, and a great learning exercise. Dan has made full instructions and all the (very simple) Python you’ll need available at his website: if you’ve got some time this weekend and are in charge of a bored child, I can’t think of a better way to spend a couple of hours.

No comments:

Post a Comment