hit
counter

So Many Twitter Bots

Internet, Programming

Since making @HoroscopeBot and @EveryBookBot, I’ve been on what you might call a bot-making rampage. I’ve really enjoyed tinkering with tiny scope coding projects that can be finished over a weekend, as opposed to my game-making side projects that often take months. Here, briefly, are five new bots I’ve assembled over the last few weeks:

@RandomChessBot plays random chess moves until it finds a checkmate, then tweets the final board state. This bot was particularly easy to code thanks to Jeff Hlywa’s excellent chess.js library, which provides a list of legal moves and exports the board state in ASCII. It’s worth noting that the majority of random chess games do not end in checkmate, but rather in an “insufficient material” draw state (the bot disregards these results.)

My friend Peter Javidpour made an amazing website called See Hear Party, which plays GIFs in time with the beat of a song (using Giphy & SoundCloud). As soon as he demoed it, I immediately wanted to help promote it with a Twitter bot. @SeeHearPartyBot pairs three random GIF search terms with a random electronic song from SoundCloud, occasionally creating an affecting juxtaposition or serendipitous harmony. This was also the first bot I implemented in Python instead of JavaScript.

@GameOfLifeBot tweets GIFs of Conway’s Game of Life simulated for 100 generations from a random initial seed. I used Tristan Hearn’s game of life library; since his implementation uses matplotlib, it was easy to export each generation as an image using various colour maps. I then used images2gif to assemble the individual frames into an animated image. This bot has inexplicably been my most popular bot since @HoroscopeBot; maybe people just like GIFs?

I noticed that Twitter has an official account that follows every verified user (a.k.a. “key individuals and brands”). This gave me a silly idea for a bot that tweets the out-of-context descriptions from the bios of random verified accounts. Fortunately this concept only took a few hours of coding to get up and running, and @VerifiedBioBot was born.

My most recent Twitter bot is @TinyCrossword, and it’s a personal favourite. It generates tweet-sized crossword puzzles, drawing clues from Simple English Wikipedia. For a tweet with an image (117 characters remaining), each clue can be no more than 36 characters long. It creates a new puzzle every day at noon PST, then tweets the solution a few hours later. This bot also scans the replies it receives, and will credit the first person who solves the puzzle correctly (sadly, nobody has yet to do so). I’m glad that I finally came up with a bot idea that was interactive!

These five new bots bring my total to eight. Sadly these will also be my last, at least for now. I’ve been using these short development cycles to procrastinate one some of my larger side projects. Making bots has been extremely entertaining and valuable, but I’m ready to get back to some meatier long term endeavours.

Also, if you’re interested in bots, be sure to check out the livestream of Darius Kazemi’s Bot Summit 2014 this weekend.

Tags: ·  ·  · 

© 2007-2024 Matthew Gallant. Powered by Wordpress. Privacy Policy.