I am trying to authenticate using Reddit from R using RCurl based on this example from Reddit github :
curl -X POST -d 'grant_type=password&username=reddit_bot&password=snoo' --user 'p-jcoLKBynTLew:gko_LXELoV07ZBNUXrvWZfzE3aI' https://ssl.reddit.com/api/v1/access_token
I tried converting it to an RCurl command as follows:
postForm("https://ssl.reddit.com/api/v1/access_token?grant_type=password",
username = "MyUserName",
password = "MyPassword",
.opts = list(userpwd = "MyClientid:MySecret")
)
But I get an error message: Error: Unauthorized
I'm not sure what I'm really doing with the conversion of the curl command to Rcurl. Thanks for any help you could provide!
source
share