Crossposts Reddit posts to Mastodon
| .env.example | ||
| .gitignore | ||
| cleanup.py | ||
| environment.yml | ||
| masto.py | ||
| README.md | ||
| reddit.py | ||
| script.py | ||
Reddit Mastodon Crossposter
Prerequisites
- Python 3
- conda/mamba
- FFmpeg
Usage
-
Install conda env with
conda env create -f environment.yml. -
Initialize PRAW with e.g.
reddit.py(please refer to the PRAW docs). -
Initialize Mastodon.py with e.g.
masto.py(please refer to the Mastodon.py docs). -
Set all
.envvariables if there are any remaining. (The code does not check for missing environment variables and assumes that everything is set correctly.) -
Create a script
post_toots.shand make it executablechmod +x post_toots.sh:#!/bin/bash cd /absolute/path/to/reddit-mastodon-crossposter /absolute/path/to/conda run -n reddit python script.py -
Open the (user) cronjob editor with
crontab -eand add the line0 * * * * /absolute/path/to/post_toots.sh > /dev/null 2>&1. This cronjob runs hourly and the command outputs are not mailed to the user. Alternatively,2>&1can be ommited for debugging purposes if the error outputs should be mailed to the user.