Crossposts Reddit posts to Mastodon
Find a file
2024-01-08 15:21:29 +01:00
.env.example Added some more example values in .env.example 2022-12-10 00:47:44 +01:00
.gitignore Update environment 2024-01-04 19:29:25 +01:00
cleanup.py Sort imports 2024-01-04 19:39:41 +01:00
environment.yml Update environment 2024-01-04 19:29:25 +01:00
masto.py Sort imports 2024-01-04 19:39:41 +01:00
README.md Update environment 2024-01-04 19:29:25 +01:00
reddit.py Sort imports 2024-01-04 19:39:41 +01:00
script.py Wait a minute after uploading a video to give Mastodon time to process it 2024-01-08 15:21:29 +01:00

Reddit Mastodon Crossposter

Prerequisites

  • Python 3
  • conda/mamba
  • FFmpeg

Usage

  1. Install conda env with conda env create -f environment.yml.

  2. Initialize PRAW with e.g. reddit.py (please refer to the PRAW docs).

  3. Initialize Mastodon.py with e.g. masto.py (please refer to the Mastodon.py docs).

  4. Set all .env variables if there are any remaining. (The code does not check for missing environment variables and assumes that everything is set correctly.)

  5. Create a script post_toots.sh and make it executable chmod +x post_toots.sh:

    #!/bin/bash
    
    cd /absolute/path/to/reddit-mastodon-crossposter
    /absolute/path/to/conda run -n reddit python script.py
    
  6. Open the (user) cronjob editor with crontab -e and add the line 0 * * * * /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.