I Made a Bible Bot: How and Why?

I’ve long been fascinated by Twitter bots — those seemingly-autonomous bits of
programming that retweet, follow, compose and respond to messages, etc. Truth be told, I’ve always wanted a bot, but since I have little to no knowledge of coding/programming language, I always assumed that creating my own was just a pipe dream. Turns out I was wrong.

In this post I’d like to first introduce you to my bot and then I’ll tell you how I made it.

After experimenting with a few different iterations over the weekend, I launched a “Bible bot” that is currently alive and well in cyberspace, tweeting its little digital heart out and gathering followers (an impressive amount so far, actually). What is it tweeting, you ask? For the most part, just gibberish that it puts together at random from the text of the King James Bible. But occasionally it comes up with something that (unbeknownst to it, of course) is really pretty clever. Here are a few examples:

I’m not sure what, if anything, I will do to hone or improve the bot in the future. It is currently doing exactly what it was designed to do, namely, amuse people in general and me in particular. It’s only been live for a few days now, so I suppose we shall see what the future holds for it.

So how did I set it up?

From start to finish, the process was actually much easier than I thought it would be, mostly because I found someone else who had already done the “heavy lifting.” That someone is Zach Whalen, an Associate Professor of English, Linguistics, and Communication at the University of Mary Washington.

Thanks to a push in the right direction from another of my Twitter pals, I stumbled upon a helpful post on Zach’s blog where he walks you through creating a Twitter bot using a Google spreadsheet that he designed. (Note that this sheet will only allow you to create a bot that posts; if you are interested in building a bot that can retweet, respond to tweets, or follow accounts, you will need to look elsewhere.) Zach’s post is remarkably clear and detailed, so I will refrain from reproducing a step-by-step here (if I can follow it, then trust me, so can you). All you need to get started is a Twitter account for your bot and a Google account for the spreadsheet.

After the initial linking up of the spreadsheet with Twitter (which can be a tad tricky, but stick with it), there are only a couple of parameters to set: frequency of posting and “data sheet.” Frequency is straightforward: how often do you want your bot to post? Every hour? Twice per hour? Once per day? Etc. “Data sheet” refers, essentially, to how you want your bot to compose its tweets.

lfmU5E0pThere are a few different options in this data sheet category, all of which are useful depending on your goals. I chose the “markov” option, meaning that my bot uses an algorithm to generate random text from a supplied body of text. The supplied body of text can be anything. The spreadsheet comes with the full text of Sense and Sensibility so that you can experiment before copying and pasting in your own text.

The text you supply the markov algorithm can be pretty much anything (I think). Because my bot is a Bible bot, my text is the Bible — King James translation. I chose King James for two reasons: 1) because I thought (rightly) that it would be funnier; and 2) because I found the King James Bible in spreadsheet form online, which meant that I could copy and paste the whole thing in about twenty minutes. Win.

With all of the text inputted, I set my bot to post a new tweet every thirty minutes (every fifteen minutes strikes me as excessive, and I got impatient having to wait an hour to see new content) and hit “start.” The results so far have been quite amusing.

And that’s why and how I made a Bible Twitter bot! Follow (or just observe) it on Twitter by clicking here.

And follow me by clicking here!

Advertisements