A Python service to wrap Reddit posts
-
Clone repository
git clone https://github.com/berkaygunduzz/geddit.git
andcd geddit
-
Build Docker image
docker build -t geddit .
-
Run Docker image
docker run -it -p 8000:8000 geddit
-
Get credentials needed for API calls to Reddit via https://www.reddit.com/prefs/apps, click
create another app
, fill details, make sure to selectscript
-
Open http://localhost:8000/api/register to register your credentials you created previous step
-
Now, you can use via make API calls
-
After installation and registiration, to add Subreddit's to be listened with API call
http://localhost:8000/api/add/<subreddit_name>
-
If you already added a Subreddit to be listened, you can get posts as
http://localhost:8000/api/get
orhttp://localhost:8000/api/get/<subreddit_name>
src/geddit/core/geddit.py
has methods to login, fetch posts and manage subreddit list- Django command
./manage.py update_posts
updates database of the Django app with recent posts from the listed subreddits, insrc/geddit/api/management/commands/update_posts.py
api
application helds API calls, database retrivals and register page- Docker image updates database by calling
./manage.py update_posts
command every minute usingcron