Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/ewanc26/mastodon-markov

a Mastodon bot based on a set of posts digested by the Markov chain.
https://github.com/ewanc26/mastodon-markov

Last synced: about 2 months ago
JSON representation

a Mastodon bot based on a set of posts digested by the Markov chain.

Awesome Lists containing this project

README

        

# Mastodon Markov Bot

[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)

This Python script generates Markov chain text based on the posts of a Mastodon account and posts them to another Mastodon account. It also periodically updates its dataset and posts a new status.

## Setup

1. Clone this repository or download the script `chain.py`.

2. Install the required dependencies by running:

```bash
pip install markovchain mastodon.py python-dotenv
```

3. Create a `.env` file in the same directory as the script and add the following variables:

```env
MASTODON_BASE_URL=
MASTODON_ACCESS_TOKEN=
DESTINATION_MASTODON_BASE_URL=
DESTINATION_MASTODON_ACCESS_TOKEN=
DESTINATION_MASTODON_CHAR_LIMIT=
SOURCE_MASTODON_ACCOUNT_ID=
```

## Usage

1. Run the script by executing in the repository directory:

```bash
python chain.py
```

2. The script will fetch recent posts from the source Mastodon account, generate Markov chain text, and post it to the destination Mastodon account at random intervals between 30 minutes and 3 hours.

3. Press `Ctrl+C` to stop the script.

## Notes

- Ensure that both the source and destination Mastodon accounts have appropriate permissions and visibility settings for posting.
- If you need to change any Mastodon or environment variables, update them in the `.env` file.
- Make sure to customise the script according to your needs, such as adjusting the character limit for generated text or the update interval for the dataset.