I Make Stuff: Bot Babies

I don’t have any new twitter bots to show you because I pick overly ambitious projects for fun! Yay! But I thought I’d show y’all how I put a bot together. Let’s jump in.

The Concept

So, you have an idea for a twitter bot? There’s a few way to tell if it’s gonna work.

  1. Can you boil it down to a formula? I had an idea to do a bot based on DSA (Democratic Socialists of America) chapter twitter accounts and while I still think it’s possible… it’s extremely difficult to boil their tweets into a formula that works.

  2. Is your idea broad enough? If you idea is based on a meme, it’s probably gonna get stale very fast, there’s only so much you can plug into it before it stops being funny.

Basically you want an idea that isn’t so huge it can’t be made into a bot and not so narrow that it’ll get old fast.

Getting Started

You have your idea, you think it’ll work as a bot. Now you just need material. I use Evernote to collect “bot food.” I’ve been casually workshopping a garden bot, so I have a note that’s just lists of plants, actions, and things to research, like how garden tips are phrased in the Farmer’s Almanac and what words are common on garden blogs. When I was making my Donald Trump bot, I checked is twitter every day to add to that note all the people he was insulting and what he was calling them, as well as his catchphrases (Sad! Run Bernie Run!).

This is also where you want to start writing down patterns you’re seeing. If you wanna do a fake soundcloud rapper bot, don’t just write down “start tweets with three fire emojis,” think about their calls to action and how they’re phrased, how they talk about themselves. You want to write down these patterns however makes sense to you, that will make writing formulas so much easier.

Writing The Code

If you’ve got your notes in order, writing code for bots is incredibly easy. Have your words sorted and you patterns noted. For the actual bot building, I use this website. To get started, create a twitter account for your bot and login to Cheap Bots, Done Quick with it. Then, turn your patterns into formula. For my Trump bot, that looks like this.

I broke down my patterns like this:

insult+name, insult+name.+exlaimation!, insult+name!

It’s super simple, and looks like this in code:

"origin": ["#adjective# #name#", "#adjective# #name#. #exclamation#", "#adjective# #name#!"]

See, simple.

Fine Tuning

If you some words or formulas to be used more than others, literally just copy and paste it into that part of the code more. If I wanted the bot to generate ten time more insults for Hillary Clinton I would copy her name ten times in “name”.

You can’t really use hashtags or quote marks in your content because they’re part of the code. I use single quotes if I really have to, but I’d recommend avoiding them altogether.

Make sure you test it! CheapBots has a test function at the bottom of the page. Twitter’s 140 character limit used to be a real pain in the ass when generating content, but even now I would aim for under 200 just to be sure all the combinations can be posted.

I know this is a really basic overview, but feel free to reach out if this is something you want to try and have questions! Thanks for reading!