This is just a quick post to gather together in one place some of the resources I’ve used to build my stable of twitter bots, chat bots, and generative fictions etc. Sometimes, I’ve chained together different generative methods so that the same bot is tweeting from a grammar, a markov chain, and _ebooks-like nonsense!
Stop me. I need help.
- A great place to get started with Twitter bots is Zach Whalen’s google spreadsheets bot. Zach walks you through the set up, and then you will have a bot that draws its tweets, mad-libs style, from columns of different text, or from markov chains based on a source text, or indeed, whimsical remixing of an existing twitter account’s posts a la horse_ebooks http://www.zachwhalen.net/posts/how-to-make-a-twitter-bot-with-google-spreadsheets-version-04/
- the next port-of-call is cheapbotsdonequick.com. This is an online editor to build a bot that tweets (and responds to tweets) using a generative grammar (in this case, tracery.io; check out that site for nitty gritty details). In essence, you define an ‘origin’ that maps the pattern for the tweet to be generated. Your grammar is formated as json, and tracery understands how to build from that. For instance:
{
“origin”: [“this could be a tweet”, “this is #alternatives# tweet”, “#completely different#”],
“alternatives” : [“an example”, “a different”, “another”, “a possible”, “a generated”, “your next”],
“completely different” : [“and now for something completely different”, “so long and thanks for all the fish”, “or, maybe, #alternatives# badger”]
}
will tweet out something like:
“this could be a tweet”
“this is a possible tweet”
“or, maybe, a different badger”
That final example shows one of the neat features of tracery, the ability to nest things. There’s an awful lot more you can do than this, of course; you can feed it emojis, or svg, or urls… see https://twitter.com/TinyAdv for such a bot. Cheapbotsdonequick is how I built TinyArchae. You can have your bot tweet at another account, so be careful. Source for TinyArchae as it stood back in August 2016 is here. Useful word corpora for such bots may be found here.
Now, you can also devise webpages that are fed by Tracery as well. Here’s a site report generated anew each time you reload the page: https://smgprojects.github.io/bots/traceryWeb/ and here’s the source:https://github.com/smgprojects/bots/tree/master/traceryWeb. The file you’d want to alter is ‘grammar.js’. Notice in the ‘origin’ there I create a random site name which I then feed to the variable ‘digsite’ so that the name is used correctly in the rest of the report. Cool, eh?
Tracery can be used in games: See ‘Interruption Junction’ by Squinky https://github.com/squinky/interruption. I swapped out Squinky’s vocabulary for archaeological flim-flam, as I felt the situations were very comparable. My version: http://graeworks.net/tinyarchae
Ok, so there’s a lot of fun to be had with tracery. I haven’t even begun to scratch the surface. What about something a bit more clever? Enter chatbots. I’ve been playing with https://www.onsequel.com/ to build a facebook bot, https://www.facebook.com/provenancebot. The problem I’ve been having there is that my text often gets truncated, as I can’t quite divine how much is available, and why the webversion should have truncated text is beyond me. Anyway, if you’ve done any Twine then the basic approach of Sequel will feel familiar.
Here’s what it looks like on the inside:
So, that’s a quick roundup of some of what I’ve been doing with bots. My very first bot was probably the most useful: https://twitter.com/botarchaeo. This uses https://dlvrit.com/ to marshall the RSS feeds of a number of journals into one location, and then to tweet ’em out. Simple, stupid, and useful.
There’s more that can be done, and I’m supposed to be giving a 5-min lightening thing at CAA in Atlanta on ‘the madness of the bots’ along those lines. So stay tuned.
Have fun!
(featured image: Bot Sketch by Eric Benacek)