Twitter Bots

I’ve built a few Twitter bots, and have a long list of bots I haven’t yet gotten around to making. Most of the bots mentioned here are currently on pause while I change around my server.

Pendulum Bot


My most recent bot is the Pendulum Bot. It’s set up to tweet models generated by my pendulum simulator script, with the parameters initialised randomly.

In order to function as a bot, it uses the command line interface for OpenSCAD to first render a PNG file of the model at a low detail level. It then proceeds to render the final corresponding STL file, and when finished pushes itself to a GitHub repository.

Once the push has finished, the bot tweets the parameters it ran with, the preview picture, and a link to the STL file on Github, ready to download!

Since this bot is very computationally intensive, it runs only once per day.

Every Brexit


Every Brexit was set up as a direct response to the nonsensical, confusing and downright absurd news reporting surrounding the EU referendum and the following fallout from it.

I’ve never been a fan of the word “Brexit” in isolation, but when the time came to discuss the terms of the UK’s exit from the EU, it got combined with various adjectives which were supposed to describe the vision of the transition process. Instead, they just served to make the whole debacle more confusing.

Since the news coverage was already borderline dadaist, why not take the idea to it’s logical, absurdist limit? The bot was therefore set up to tweet the word “Brexit”, preceded by every single adjective I could find. The corpus of adjectives is taken directly from WordNet, and contains over 20,000 adjectives.

In order to make it more interesting, the bot also performs a Google Image search for the adjective, and then overlays the union flag on top of the first result, including it in the tweet.

Simpsonwave Bot


Simpsonwave, for the uninitiated, is an extension of vaporwave into the Simpsons universe. It was once (and sort of still is) very popular on YouTube.

Because the themes of Simpsonwave are reasonably rigid, it’s a fairly easy thing to replicate in a bot.

My bot pulls frames from episodes of the Simpsons from an online repository, and applies random vaporwave-esque glitches to them. It then grabs a random Simpsons quote from another online source, converts the text to FULL WIDTH CHARACTERS, and tweets the combination.

The end goal was to replicate the relaxing, 90’s haze effects of Simpsonwave, generatively.

Air Quality Bot

I was inspired by this cool piece of work by Ben Porter to try building something that would automatically update my Twitter display picture.

I’m lucky enough to live in Newcastle Upon Tyne, home to the Urban Observatory, a research project which monitors key environmental metrics about the city’s urban environment. The project draws data from sensors all around the city, measuring things like air quality, noise pollution and weather. It also has an open API, so people like me can do stupid things with the data!

The nearest sensor to my house is an air quality sensor (50m away!), so I decided to make my Twitter display picture a live visual indicator of the level of pollution where I am. To do this, I wrote a Python script that checks for new sensor readings from the API every 20 minutes, and then overlays my normal Twitter avatar with grey smoke. The script renders the smoke as being more opaque the worse the air pollution gets, until the picture disappears entirely.

The results of what the bot does were visible directly on my Twitter.