Skip to content

Fuyukai/Brooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brooks

See Brooks in action

Brooks is a Twitter bot for posting tweets from a pre-populated tweet list generated by the gpt2-simple package. Brooks requires Python 3.7+ and the Poetry tool installed. Brooks is licenced under the GPL version 3.0 (or later).

Installation

  1. Clone this repository
  2. poetry install
  3. Set up your bots in the bots/ directory
  4. poetry run python3.7 bot.py

Bot Setup

Brooks will tweet out a random tweet from the tweet list for every single bot simultaneously. A bot is defined by a folder under bots/, with a bot.json defining the API keys and a tweetlist.txt defining the tweets to be tweeted. Example config.json:

{
    "api_key": "...",
    "secret_key": "...",
    "token": "...",
    "secret_token": "..."
}

The tweet list must delimit all tweets with the EXACT STRING ====================. If your tweets are generated from the gpt2-simple library, they will be correctly delimited.

Otherwise, copy/paste that string and ensure all tweets to be posted are separated by it.

Tweets over 280 characters will be dropped from the list. Tweets will be sent the exact number of times they appear in the tweet list.

Brooks will crash when it runs out of tweets from any bot.

Checkpoints

Brooks will save a "checkpoint" file after every tweet is sent, to ensure that if the bot crashes or needs to be taken offline it will resume tweeting from where it left off. This is just a JSON array of all tweets not sent.

Editing the tweet list whilst a checkpoint file exists will have no effect. Either edit the checkpoint file, or delete the checkpoint file and allow the bot to run fresh from the tweet list.