Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ethanc/snoopy
Monitor users on Reddit and notify about post activity.
https://github.com/ethanc/snoopy
comment discord monitor notification notifier pin pinned post python reddit redditor reply sticky thread user watcher webhook
Last synced: about 1 month ago
JSON representation
Monitor users on Reddit and notify about post activity.
- Host: GitHub
- URL: https://github.com/ethanc/snoopy
- Owner: EthanC
- License: mit
- Created: 2020-02-11T03:59:19.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-08-25T04:24:54.000Z (6 months ago)
- Last Synced: 2024-11-10T13:05:33.583Z (3 months ago)
- Topics: comment, discord, monitor, notification, notifier, pin, pinned, post, python, reddit, redditor, reply, sticky, thread, user, watcher, webhook
- Language: Python
- Homepage: https://hub.docker.com/r/ethanchrisp/snoopy
- Size: 254 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Snoopy
  
Snoopy monitors users on Reddit and notifies about post activity via Discord.
![]()
## Setup
[Reddit API](https://github.com/reddit-archive/reddit/wiki/OAuth2#getting-started) credentials are required for functionality, and a [Discord Webhook](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) is recommended for notifications.
Regardless of your chosen setup method, Snoopy is intended for use with a task scheduler, such as [cron](https://crontab.guru/).
**Environment Variables:**
- `LOG_LEVEL`: [Loguru](https://loguru.readthedocs.io/en/stable/api/logger.html) severity level to write to the console.
- `LOG_DISCORD_WEBHOOK_URL`: [Discord Webhook](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) URL to receive log events.
- `LOG_DISCORD_WEBHOOK_LEVEL`: Minimum [Loguru](https://loguru.readthedocs.io/en/stable/api/logger.html) severity level to forward to Discord.
- `REDDIT_USERNAME` (Required): Reddit account username.
- `REDDIT_PASSWORD` (Required): Reddit account password.
- `REDDIT_CLIENT_ID` (Required): [Reddit API](https://github.com/reddit-archive/reddit/wiki/OAuth2#getting-started) application client ID.
- `REDDIT_CLIENT_SECRET` (Required): [Reddit API](https://github.com/reddit-archive/reddit/wiki/OAuth2#getting-started) application client secret.
- `DISCORD_WEBHOOK_URL`: [Discord Webhook](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) URL to receive Reddit activity notifications.**Configurable Variables** (`config.json`)**:**
- `users` (Required): Array of dicts containing options for watching Reddit users.
- `username` (Required): Username of the desired Reddit user
- `label`: Label to be displayed alongside the username and post flair
- `communities`: Array of strings containing Reddit subreddit names### Docker (Recommended)
Rename `config_example.json` to `config.json`, then provide the configurable variables.
Modify the following `compose.yaml` example file, then run `docker compose up`.
```yml
services:
snoopy:
container_name: snoopy
image: ethanchrisp/snoopy:latest
environment:
LOG_LEVEL: INFO
LOG_DISCORD_WEBHOOK_URL: https://discord.com/api/webhooks/YYYYYYYY/YYYYYYYY
LOG_DISCORD_WEBHOOK_LEVEL: WARNING
REDDIT_USERNAME: XXXXXXXX
REDDIT_PASSWORD: XXXXXXXX
REDDIT_CLIENT_ID: XXXXXXXX
REDDIT_CLIENT_SECRET: XXXXXXXX
DISCORD_WEBHOOK_URL: https://discord.com/api/webhooks/XXXXXXXX/XXXXXXXX
volumes:
- /path/to/config.json:/snoopy/config.json:ro
```### Standalone
Snoopy is built for [Python 3.12](https://www.python.org/) or greater.
1. Install required dependencies using [uv](https://github.com/astral-sh/uv): `uv sync`
2. Rename `.env_example` to `.env`, then provide the environment variables.
3. Rename `config_example.json` to `config.json`, then provide the configurable variables.
4. Start Snoopy: `python snoo.py`