Crossposts Reddit posts to Mastodon
.env.example | ||
.gitignore | ||
environment.yml | ||
masto.py | ||
README.md | ||
reddit.py | ||
script.py |
Reddit Mastodon Crossposter
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
.env
variables if there are any remaining. -
Create an
post_toots.sh
and make it executable:#!/bin/bash conda activate reddit python "/absolute/path/to/script.py" conda deactivate
-
Open the a (user) cronjob editor with
crontab -e
and 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>&1
can be ommited for debugging purposes if the error outputs should be mailed to the user.