Making a filming, photographing, auto-tweeting bot

At Liquid Light, we often have hack days - a day where we down client work and hack something together for a day.

Working on Kensington Street, the graffiti is a prime target for tourists and photographers. We wanted something that captured the wonders of what we see every day.

After our first (failed) streaming iteration, we mutilated it into something more interactive. Something that will respond to users there on the street.

Out of it, @graffcam was born. A tweetable bot which replies with a picture or a 7 second video of what it sees.

Written entirely in Python, this bot will wait for a mention and then reply with a video.

All the code for this can be found, as ever, on Github

The repo contains instructions on how to install it, this blog post points out noteworthy code.

The API #

There are a lot of python twitter API libraries out there - the Twitter website lists a few. After much reading and contemplating, I decided to go with the simply named TwitterAPI. Getting set up was easy - once you had made a twitter app the getting and sending of tweets was the next step.

Mike Street

Written by Mike Street

Mike is a front-end developer from Brighton, UK. He spends his time writing, cycling and coding. You can find Mike on Twitter.