Reddit is a network of communities based on people’s interests. Each of these communities is called a subreddit. Users can subscribe to multiple subreddits to post, comment and interact with them.
A Reddit bot is something that automatically responds to a user’s post or automatically posts things at certain intervals. This could depend on what content the users post. It can be triggered by certain key phrases and also depends on various subreddits regarding their content.
In order to implement a Reddit bot, we will use the Python Reddit API Wrapper (PRAW). It allows us to login to the Reddit API to directly interact with the backend of the website. More information about this library can be found here – PRAW – Python Reddit API Wrapper
In order to get the information for these fields:
- Create a Reddit account.
- The username of the reddit account will go to the
- The password of the reddit account will go to the
user_agentis a unique identifier that helps Reddit determine the source of network requests.
client_secretare needed to access Reddit’s API as a script application. We can find them by:
- Login to your Reddit account.
- Open the link: https://www.reddit.com/prefs/apps
- The following will open up:
- Click on “create an app…”. The following fields will be requested:
- Give an appropriate name to the application and fill rest of the fields:
- Click on “create app”.
- The text in the green box is the
- Click on “edit”. The text in the green box is the
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Python | PRAW - Python Reddit API Wrapper
- Login and Registration Project Using Flask and MySQL
- Python | Simple registration form using Tkinter
- Image Registration using OpenCV | Python
- Python - Making a Reddit bot with PRAW
- Python PRAW - Checking whether a redditor is an employee of Reddit or not
- Python PRAW – Check whether a redditor has Reddit premium or not
- Python PRAW - Getting the ID of a comment in Reddit
- Python PRAW - Getting the body of a comment in Reddit
- Python PRAW - Checking whether a commenter is also the author of the submission in Reddit
- Python PRAW - Checking whether a comment has been edited or not in Reddit
- Python PRAW - Getting the time when a comment was posted on Reddit
- Python PRAW - Checking whether a comment is distinguished or not in Reddit
- Python PRAW - Getting the permalink of a comment in Reddit
- Python PRAW - Getting the parent ID of a comment in Reddit
- Python PRAW - Getting the ID of the submission that a comment belongs to in Reddit
- Python PRAW - Checking whether a comment is stickied or not in Reddit
- Python PRAW - Getting the score of a comment in Reddit
- Python PRAW - Getting the subreddit on which a comment is posted in Reddit
- Python PRAW - Getting the author of a comment in Reddit
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.