reddit-mastodon-crossposter/README.md

29 lines
938 B
Markdown
Raw Normal View History

2022-12-09 00:04:01 +01:00
# Reddit Mastodon Crossposter
2022-12-09 00:10:40 +01:00
## Prerequisites
- Python 3
- conda/mamba
2022-12-09 00:04:01 +01:00
## 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](https://praw.readthedocs.io)).
3. Initialize Mastodon.py with e.g. `masto.py` (please refer to the [Mastodon.py docs](https://mastodonpy.readthedocs.io)).
4. Set all `.env` variables if there are any remaining.
5. Create an `post_toots.sh` and make it executable:
```sh
#!/bin/bash
conda activate reddit
python "/absolute/path/to/script.py"
conda deactivate
```
6. Open the a (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.