Mastodon image dump bot.

Lerk a238d580f9 'main.py' ändern 5 months ago
.gitignore 287514a5f5 initial 1 year ago
README.md 82889a2655 add link 5 months ago
config-sample.json b67d55424b fix bug 1 year ago
main.py a238d580f9 'main.py' ändern 5 months ago
requirements.txt 6a72dd25bf fix bug 1 year ago

README.md

Memedump

Mastodon bot that posts random images from a folder.

Usage

  1. Create a memes directory inside this folder and put your images into it
  2. Copy and edit config-sample.json to config.json
  3. Run pip install -r requirements.txt to install dependencies
  4. Run python ./main.py once to generate credentials
  5. Run python ./main.py again (when successfully registered) to post

Since the path to the memes directory is relative, you need to be inside the folder of this README.md for the bot to work.

Configuration

Here is a list of the most important configuration options:

key default description
cw null Sets the content warning of the post, null for no cw
mark_sensitive true Decides whether or not the media should be marked as sensitive
site "https://botsin.space" The Mastodon instance of the Bot
dir ./memes Path to the directory where random files to post will be chosen from
repost_threshold 10 Number of retries when a randomly selected file was already posted

Scheduling

Since posting only consists of running main.py with a valid (registered) config, there are multiple ways of scheduling posts. Before doing scheduling make sure to generate the client credentials by running main.py once in an interactive terminal.

Cron (Linux)

The simplest way to do this is running crontab -e as the user the bot should run as and adding a line like:

*/30 * * * * cd /path/to/memedump/ && /path/to/python main.py 

This would result in one post every 30 minutes.