Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/ewanc26/mastodon-markov
- Owner: ewanc26
- License: mit
- Created: 2024-03-02T17:42:24.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-04-07T14:56:33.000Z (10 months ago)
- Last Synced: 2024-04-07T19:38:42.985Z (10 months ago)
- Language: Python
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.