Daniel Tafmizi Dr. Friedman Lis 4370 redditApiR Github: DanielDataGit/RedditApiR: redditApiRPackage Authenticating Reddit Account: Create or log into account Ensure account is verified by going to account settings-email-verify Go to preferences (reddit.com) Create an App (personal use script for data collection needs) Use the following script: library(httr) # Initialize parameters client_id <- "Code under "personal use script" " client_secret <- "next to secret" user_agent <- "app name" username <- "Account username" password <- "Account Password" # Get the access token response <- POST( "https://www.reddit.com/api/v1/access_token", authenticate(client_id, client_secret), body = list( grant_type = "password", username = username, password = password ), encode = "form", user_agent(user_agent) ) # Extract the access token token <- content(response)$acc...
Comments
Post a Comment