Yesterday, I wrote about diving into the world of Twitter Bots for Networked Narratives, and my interest in creating my own Twitter Bot, if only to understand the process of how it is done.
Hey #NetNarr – What’s So Funny about Peace Love and Raindrops?
— PeaceLove&Bot (@PeaceLoveAndBot) February 6, 2017
Well, I did it. Check out the PeaceLove&Bot bot. Every six hours, the PeaceLove bot will send out a new tweet that begins with the lines made famous in the Elvis Costello song (but written by Nick Lowe) with random word replacing “Understanding” in the lyrics. I’ve included the #NetNarr hashtag in the code, too, so that the tweets get sent into the NetNarr twitter stream.
Phew. It was both easier and more difficult than I thought, and it took a long time on Saturday to get all of the programming pieces together. I used a free program called Tracery and hosting site called Cheap Bots by the very generous @GalaxyKate and George Buckinham.
Hey #NetNarr – What’s So Funny about Peace Love and Remix?
— PeaceLove&Bot (@PeaceLoveAndBot) February 5, 2017
The easy piece was that Kate and George really make the programming possibilities fairly simple to use. The difficult part was the ins and outs of making sure I was writing my code correctly, for any little thing made the bot go boink (hard to resist that alliteration and Scooby Doo onomatopoeia).
First, I had to create an entire new Twitter account. Which I did. But then when I connected the Cheap Bots to the account, Twitter got mad and shut down my account, asking me for a phone number to reinstate the account. I did that, and then realized that now my main Twitter account could not use the same mobile phone number as my bot account … ack … I confirmed that Cheap Bots could use my new Twitter bot account, and then reversed the use of the phone number (which I use as a validation tool for my Twitter account).
Second, I had to figure out the coding of Tracery. I looked at Kate’s example, and how it worked, and followed a link to her tutorial (which was more complicated to me, a non-coder, than I wanted it to be). I tried to tinker with the program and kept failing. Hmmm. I Google searched Tracery and found an interactive site called Bother that allowed me to replace its code with my own, and generate a code that Tracery would use. Phew. I still spent a lot of time tinkering but it worked. You can look at and remix my code, too, if it helps.
Third, I was stuck with the question. I am making a Twitter Bot, but what should it say to the world? I had Elvis Costello in my head, singing along with What’s So Funny (about Peace, Love and Understanding) and wondered if that might be a way to keep true to staying positive in this negative time of Trump, while also keeping the underlying mechanics of the Bot simple. It would use a common phrase but replace a word each time with a random word from a database.
Fourth, what database? I realized that while ideally I would have my bot draw from some outside database, I could not take on the technical aspects of that. Tracery allows you to make your own database right in the code, so I did that, mulling over phrases and words that would remain positive and still fit in the song title. At one point (and I might return to this), I had this idea of using the invented, made-up words from my students’ Crazy Collaborative Dictionary (which I wrote about the other day) as the database for the bot. But when I experimented, the bot didn’t seem to want to recognize the invented words. It may have been something that I did wrong with the code. Not sure. So I went back to my original database.
What’s So Funny about Peace Love and Resistance?
— PeaceLove&Bot (@PeaceLoveAndBot) February 4, 2017
And now? The PeaceLove&Bot is loose upon the world. Every six hours, a new tweet is sent out. I may yet add more words to the database, and heck … I invite you: What words or phrases should end the What’s So Funny about Peace Love and ?????? Leave a comment here at the blog. I’ll add your word in.
Peace (not so funny in these tumultuous days),