Code Monkey home page Code Monkey logo

twitterbots's Introduction

How to Write Twitter Bots

A twitterbot workshop using Tracery and CheapBotsDoneQuick

Overview

  • Look at some twitter bots, understand how they work
  • 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 functioning bots

Let's look at some twitter bots

@TwoHeadlines by Darius Kazemi @FellasBot by Darius Kazemi @the_ephemerides by Allison Parrish @thinkpiecebot by Nora Reed @thielspotting by Todd Anderson @autoflaneur @MagicRealismBot by Chris Rodley @bot_teleport @softlandscapes by George Buckenham @thetinygallery

Tracery

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.

Time to 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 on to have a lot of possibility.

  • Start with a recent news headline, a fun meme, or a subject you're interested.
  • Make a starter template sentence
  • Make lists of things that could be swapped out
  • Generate!

Cheap Bots, Done Quick

Cheap Bots Done Quick is a fantastic twitterbot 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
  • 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 (let people know it's a bot)
  • Done!

Going Further

Tracery can be used in any javascript project, including with p5, to make generative websites and games. Visit the github repo for more on how to use it. Check out Interruption Junction as something a little different using Tracery.

You can make more advanced Twitter bots that do things like markov text generation, uploading images, replying, and showing p5/processing images by programming them yourself in Node or Python. Dan Shiffman's The Coding Train has a great set of videos on making a Twitter bot in Node.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.