Reddit Data Mining with Python

Requires Python 3.x and the PRAW libary.

To Install the PRAW library, execute:

pip install praw

Head over to https://www.reddit.com/prefs/apps to get Reddit API credentials.

Fill out the following variables in the script:

username = ""
password = ""
clientid = ""
clientsecret = ""

Run the script with python reddit.py.

It will prompt you to:

  • Specify an filename for your CSV output
  • To list one or several search terms (comma delimited)
  • To specify your sorting method (relevance, hot, top, new, or comments)
  • Whether you’d like to examine all of reddit (yes or no question), or isolate to one or more subreddits (comma delimited).

Go!

The Script

How to coming soon…