dispatcher-service
Small service that streams reddit submissions and comments to respective endpoints.
Reddit credentials
- Create new integration credentials at https://www.reddit.com/prefs/apps
- name:
whatever_you_like_but_perhaps_flam-flam - web app:
select this option - description:
whatever you like, or nothing, it's not mandatory - about url:
https://flam-flam.github.io - redirect uri:
https://flam-flam.github.io - create app:
click this button
- name:
- Create a new file called
.envin the root of the repo with the following contents. It’s in the.gitignoreso will not be committed:REDDIT_CLIENT_ID=<the string underneath "web app"> REDDIT_CLIENT_SECRET=<the string next to "secret">
Local dev / docker
Requires python>=3.9 or docker.
Build and run using the environment variables in .env file
and config.json:
make build
Run the image with
make run
Note: there are issues with running this on Windows (see this PR discussion), but it should be okay running in the docker container.
Note: if you’re running the code outside the docker container, you need to set
CONFIG_PATHenvironment variable to yourconfig.jsonpath.
Tests
Run the tests with make test.
Data output
The code sends a POST request to endpoints in config.json with
JSON payload, same for both comments and submissions, e.g.:
{"id": "j643al2", "created_utc": "2023-03-10T13:12:18+00:00"}