Not logged in
Talk
Contributions
Create account
Log in
Navigation
Main page
About
People
Publications
Teaching
Resources
Research Blog
Wiki Functions
Recent changes
Help
Licensing
Page
Discussion
Edit
View history
Editing
Intro to Programming and Data Science (Fall 2024)/Reddit authentication setup
From CommunityData
Jump to:
navigation
,
search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
We're going to be using Reddit as a context for learning to gather web data. Like many APIs, in order to use the Reddit API, you need a developer account. This is pretty easy on Reddit. # Create a reddit account at https://www.reddit.com/ # Go to https://www.reddit.com/prefs/apps and click "Create an app" # Enter the following (or similar): #* Name: COM 674 Project App #* Description: This bot will be used to collect data as part of a course at Purdue University. #* About URL: LEAVE BLANK #* Redirect URL: http://localhost:8080 (We won't actually be using this) #* For the application type, select "Script" and submit. # Create a new .py file called reddit_authentication.py that looks something like: client_id = "_anb-dsxipuqf7jA9wzeMqZ" client_secret = "4kXxiBOFdPY1HBw4843sgm6oiTYbWkFgz" user_agent = "python:COM 674 class project:v1.0 (by /u/yourusername)" username = "yourusername" password = "yourpassword" * The client_id is found at the top left of the apps page, under your app's name. The client secret is right under that. We'll use this authentication file in the future.
Summary:
Please note that all contributions to CommunityData are considered to be released under the Attribution-Share Alike 3.0 Unported (see
CommunityData:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:
Cancel
Editing help
(opens in new window)
Tools
What links here
Related changes
Special pages
Page information