A Twitter bot workshop using Tracery and Cheap Bots Done Quick.
- Look at some Twitter bots, and understand what they are.
- Learn Tracery, a simple method of Mad Libs-style text generation
- Make our own generators using Tracery
- Learn how to use Cheap Bots Done Quick, a beginner-friendly platform for hosting Twitter bots
- Turn our generators into real bots
(Note: Not all of these use CheapBotsDoneQuick)
- @TwoHeadlines by Darius Kazemi
- @SortingBot by Darius Kazemi
- @RapNameBot by Darius Kazemi
- @everyword by Allison Parrish
- @gayeveryword by ??
- @the_ephemerides by Allison Parrish
- @thinkpiecebot by Nora Reed
- @mothgenerator by Everest Pipkin and Loren Schmidt
- @ArtAssignBot by Jeff Thompson
- @autoflaneur by Harry Giles
- @MagicRealismBot by Chris Rodley
- @bot_teleport by Rick Hoppmann
- @softlandscapes by George Buckenham
- @thetinygallery by Emma Winston
- @tinycarebot by Jonny Sun
- @Pentametron by Ranjit Bhatnagar
Tracery is a text generation library created by Kate Compton. It's basically a big list of lists and templates you use to generate text in a Mad Libs-style, where certain parts of a sentence are selected at random from a larger group.
- Online Tracery Editor
- Corpora big lists of stuff!
- Lets looks at some of the JSON files included in this repo and plug them in!
Let's try making our own! Break into groups and come up with an idea for your generator. Good bots have a simple, narrow theme that is then expanded upon to have a lot of possibility.
- Start with a recent news headline, a fun meme, or a subject you're interested. Don't overthink it!
- Make a starter template sentence
- Make lists of things that could be swapped out
- Generate!
Cheap Bots Done Quick is a fantastic Twitter bot hosting platform by George Buckenham that lets you turn any Tracery generator into a Twitter bot. Here's all you need to do:
- Create a new Twitter account. If you can, putting in a phone number will keep your account from getting shut down.
- Log in to Cheap Bots Done Quick with your new Twitter account
- Paste in the grammar from your Tracery generator
- Test to make sure it works
- Set how often you want to tweet
- Go back into the Twitter account and make a nice profile and banner image and description. Make sure you let people know it's a bot.
- Done!
To quote Leonard Richardson and an axiom of the botmaking community, "Bots should punch up". If your bot makes jokes at someone's expense, make sure they're higher status than you, aka it's cool to make bots that make fun of corporations, politicians and celebrities, but its not cool to make bots that bully and harass regular people, especially groups of people that put up with a lot of that harassment already.
If your bot "accidentally", or you purposefully program it so that it generates text that is harmful in any way, for example, if the text is sexist, racism, ableism, and so on, that is a problem. It is your responsibility as a bot-maker to think about and prevent this. You are responsible for the actions of your bot, especially if it hurts another person. If you're unsure, err on the side of caution.
- Tracery Github repository - The source code for Tracery. You can use it in any JavaScript project!
- Interruption Junction - a non-bot (a game!) using Tracery.
- Make a Tracery bot on Mastodon, using this Glitch.com template.
- Dan Shiffman's The Coding Train has a great set of videos on making a Twitter bot in Node.js, without using Tracery/CBDQ. You can program one from scratch if you want, and do more complex stuff!