|
5 months ago | |
---|---|---|
.gitignore | 1 year ago | |
README.md | 5 months ago | |
config-sample.json | 1 year ago | |
main.py | 5 months ago | |
requirements.txt | 1 year ago |
Mastodon bot that posts random images from a folder.
memes
directory inside this folder and put your images into itconfig-sample.json
to config.json
pip install -r requirements.txt
to install dependenciespython ./main.py
once to generate credentialspython ./main.py
again (when successfully registered) to postSince the path to the memes
directory is relative, you need to be inside the folder of this README.md
for the bot to work.
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 |
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.
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.