Skip to content
/ Snoopy Public

Monitor users on Reddit and notify about post activity.

License

Notifications You must be signed in to change notification settings

EthanC/Snoopy

Repository files navigation

Snoopy

GitHub Workflow Status Docker Pulls Docker Image Size (tag)

Snoopy is a Reddit user watcher that stickies comments and reports activity via Discord.

Setup

Reddit API credentials are required for functionality, and a Discord Webhook is recommended for notifications.

Regardless of your chosen setup method, Snoopy is intended for use with a task scheduler, such as cron.

Environment Variables:

  • LOG_LEVEL: Loguru severity level to write to the console.
  • LOG_DISCORD_WEBHOOK_URL: Discord Webhook URL to receive log events.
  • LOG_DISCORD_WEBHOOK_LEVEL: Minimum Loguru severity level to forward to Discord.
  • REDDIT_USERNAME (Required): Reddit account username.
  • REDDIT_PASSWORD (Required): Reddit account password.
  • REDDIT_CLIENT_ID (Required): Reddit API application client ID.
  • REDDIT_CLIENT_SECRET (Required): Reddit API application client secret.
  • DISCORD_WEBHOOK_URL: Discord Webhook 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 docker-compose.yml example file, then run docker compose up.

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 or greater.

  1. Install required dependencies using Poetry: poetry install --no-root
  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