Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joenas/node-top-reddit
Fetch Reddit feeds, pick posts matching your desired amount of upvotes, filter out duplicates and post a webhook
https://github.com/joenas/node-top-reddit
cronjob node reddit
Last synced: 8 days ago
JSON representation
Fetch Reddit feeds, pick posts matching your desired amount of upvotes, filter out duplicates and post a webhook
- Host: GitHub
- URL: https://github.com/joenas/node-top-reddit
- Owner: joenas
- Created: 2021-10-02T08:12:04.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-19T04:32:39.000Z (over 1 year ago)
- Last Synced: 2024-10-30T16:49:24.716Z (about 2 months ago)
- Topics: cronjob, node, reddit
- Language: JavaScript
- Homepage:
- Size: 242 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](https://github.com/turt2live/matrix-appservice-webhooks/)).
All the jobs will currently run at a 15 minute interval.
## Getting started
### Install dependencies
```bash
yarn install
```### Set up environment variables
```bash
cp .env.example .env
# edit file
```### Configuration
```yaml
- 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
```bash
cp config/reddit.yml.example config/reddit.yml
```### Start server
```bash
yarn dev
```### Docker
To test the Dockerfile you need to build the image. Also make sure the database is up (`docker-compose up -d`)
```bash
docker build -t top-reddit .
```If you changed any of the entries in `.env` you might have to change them here as well.
```bash
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](https://github.com/dokku/dokku/blob/master/docs/advanced-usage/persistent-storage.md#usage).
Since we're using a Dockerfile you also need to go through [these steps](https://github.com/dokku/dokku-letsencrypt#dockerfile-deploys).### TODO
- [ ] webhook templates
- [ ] cron schedule in config
- [ ] other integrations?