Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fuyukai/brooks

Brooks GPT bot
https://github.com/fuyukai/brooks

bot gpt gpt-2 gpt2 python python3 twitter twitter-bot

Last synced: 7 days ago
JSON representation

Brooks GPT bot

Awesome Lists containing this project

README

        

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``:

.. code-block:: 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.