A Python service to wrap Reddit posts
-
Clone repository
git clone https://github.com/berkaygunduzz/geddit.gitandcd 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/getorhttp://localhost:8000/api/get/<subreddit_name>
src/geddit/core/geddit.pyhas methods to login, fetch posts and manage subreddit list- Django command
./manage.py update_postsupdates database of the Django app with recent posts from the listed subreddits, insrc/geddit/api/management/commands/update_posts.py apiapplication helds API calls, database retrivals and register page- Docker image updates database by calling
./manage.py update_postscommand every minute usingcron