Harvest Reddit Data with Top-Level Comments
This script can be used for harvesting data from the Reddit API. As per Reddit API terms, you must create an account at reddit.com and then register an app and get authentication keys first before harvesting data.
In order to run this script, you need to save it to your computer and remember where you saved it. You also need python
installed on your computer.
To find out whether you have python, open your command prompt (terminal) and type python --version
.
If you don't have python installed, get python.
Once you have python installed, download this code directory by clicking the green download button at the top right of this page.
You'll need to unzip this downloaded directory. Once you do that, move the unzipped directory to a memorable location on your computer. Like your documents directory.
In your command (terminal) window, navigate to the directory (folder) where the file is installed: reddit-getter-master
.
Let's assume you put the reddit-getter-master
directory in your Documents directory on your computer.
In order to get there, type cd documents/reddit-getter-master
into the terminal.
Once inside that folder, type python reddit.py
. If you have python 3 installed, type python3 reddit.py
.
The script will run. Then find posts.txt
file in the same folder as your reddit.py
file.