Making a Twitter Bot with Cheap Bots, Done Quick!

Screenshot 2018-10-06 13.13.37

Cheap Bots, Done Quick! (CBDQ) is a fantastic resource created by George Buckenham for very quickly creating a Twitter bot based on another library, Tracery, created by Kate Compton. (See guide to Tracery here!)

Through writing some rules in JavaScript Object Notation (JSON), CBDQ will read and act out the rules to create bots that can post both text and images through using Scalable Vector Graphics (SVG) instructions.

Granting Twitter Access

Screenshot 2018-10-06 13.18.15

If creating a new Twitter bot with a unique name, create a new account and then come back to the site. Otherwise, click on the “Sign in with Twitter” button located centrally on the page.

Screenshot 2018-10-06 13.22.52

In order for CBDQ to post to your Twitter account, it must be authorized. Review what the application will be able to do and not be able to do and, if you agree, click “Authorize app”. Twitter will redirect back to the CBDQ site.

Screenshot 2018-10-06 13.25.28

By default, CBDQ will generate some example text. This is written in Tracery JSON according to an existing pattern.

In Tracery, the first step is to read all of the symbols (properties of the object) into memory. Second, it looks for origin and picks a random entry. If that pick contains a known symbol written with hashes around it (for example, #alternatives#), it expands it using that symbol and a random pick from its choices. (This continues until there are no more symbols to expand.)

Screenshot 2018-10-06 13.30.27

To see another possible output, click the refresh button and the rules will be run again. Keep clicking the refresh button to see various outputs.

Screenshot 2018-10-06 13.42.43

To see different output, change the symbols and origin properties, replacing them with choices and rules as simple or complex as wanted.

Screenshot 2018-10-06 13.41.55

CBDQ will help to warn if there is a JSON parse error and on what line(s). This can be helpful to see where a simple mistake or error might have occurred.

When, Reply, and Sharing Options

Screenshot 2018-10-06 13.46.34

Once the text has been entered into CBDQ and tested using the refresh button, the timing of the bot can be changed through a drop-down menu. It can post as fast as every 10 minutes or as slow as once a year.

Replying

Screenshot 2018-10-06 13.49.04

Through changing the drop-down option to “Reply”, CBDQ will add more options for how to reply on Twitter. Tracery JSON can also be written to respond according to complex rules.

Most importantly, CBDQ mentions that “Mentions are checked every 5 minutes, and have a 5% chance of being ignored (to prevent bots from responding to each other forever).” CBDQ cannot be used to create an instant-reply system, nor should any other bots do the same thing to respect Twitter’s rules and other users.

Sharing Options

Screenshot 2018-10-06 13.52.47

Finally, the source of the bot can be shared through selecting “Share” from the drop-down menu. It will be found on the URL provided by CBDQ.

Screenshot 2018-10-06 13.54.15

Once all settings have been configured, click “Save” to retain those changes.

Making Changes to the Bot

Screenshot 2018-10-06 13.18.15

The web browser used to access CBDQ will keep a cookie and can be used to login back to the bot. However, should the cookie be erased through closing the browser or another means, clicking on “Sign in with Twitter” using the credentials used to create the account will login back again. The bot’s settings can be changed from there.