A silly ChatGPT-powered Mastodon bot that toots a random fact every hour. Running at @mastofact
- Python 3.10+ and Pipenv
- A Mastodon access token (create one under
Development
>Your applications
>New application
>Your access token
) - An OpenAI account (see configuration section)
Customize the configuration by copying .env.example
and renaming it to .env
, then editing the parameters as desired:
MASTODON_INSTANCE="YOUR_MASTODON_INSTANCE" # e.g. https://mastodon.social/
MASTODON_BOT_TOKEN="YOUR_MASTODON_BOT_TOKEN"
OPENAI_API_KEY="YOUR_OPENAI_API_KEY"
# Optional parameters
POST_INTERVAL_SECONDS=3600 # Defaults to 3600 (1h)
- Clone the repository and navigate to the project directory:
git clone https://github.com/n3d1117/mastofact.git
cd mastofact
- Create a new virtual environment with Pipenv and install the required dependencies:
pipenv install
- Activate the virtual environment:
pipenv shell
- Use the following command to start the bot:
python bot.py
- Run the following command to build and run the Docker image:
docker-compose up
- ChatGPT from OpenAI
- Mastodon.py
This is a personal project and is not affiliated with OpenAI in any way.
MIT license. For more information, see the LICENSE file included in the repository.