Skip to content

Fetch Reddit feeds, pick posts matching your desired amount of upvotes, filter out duplicates and post a webhook

Notifications You must be signed in to change notification settings

joenas/node-top-reddit

Repository files navigation

Top Reddit

Fetch Reddit feeds, pick posts matching your desired amount of upvotes, filter out duplicates and post a webhook (currently compatible with matrix-appservice-webhooks).

All the jobs will currently run at a 15 minute interval.

Getting started

Install dependencies

yarn install

Set up environment variables

cp .env.example .env
# edit file

Configuration

- name: 'worldnews'
  url: 'https://www.reddit.com/r/worldnews.json?limit=1'
  minCount: 15
  webhookUrl: 'https://example.com'
  displayName: WorldNews

There's an example file available

cp config/reddit.yml.example config/reddit.yml

Start server

yarn dev

Docker

To test the Dockerfile you need to build the image. Also make sure the database is up (docker-compose up -d)

docker build -t top-reddit .

If you changed any of the entries in .env you might have to change them here as well.

docker run --rm \
    -e NODE_ENV=development \
    -e TZ=Europe/Stockholm \
    -e REDIS_URL=redis://localhost:6379 \
    top-reddit

Dokku

The app is prepared to deploy with dokku. The config file can be mounted with persistant storage. Since we're using a Dockerfile you also need to go through these steps.

TODO

  • webhook templates
  • cron schedule in config
  • other integrations?

About

Fetch Reddit feeds, pick posts matching your desired amount of upvotes, filter out duplicates and post a webhook

Topics

Resources

Stars

Watchers

Forks