ROauth PIN generation protocol for twitter handshake is leading to page doesn't exist error


#1

For creating a twitter application, I am using R-3.1.1, RStudio Version 0.98.983 and the updated packages twitteR (installed from github), RCurl, digest and ROauth. I am following the ROauth protocol and not the twitteR package from Hadley Wickam’s github repo because I want to use the object for the streamR functions such as filterstream.

reqURL<-"https://api.twitter.com/oauth/request_token"
accessURL<-"https://api.twitter.com/oauth/access_token"
authURL<-"https://api.twitter.com/oauth.authorize"
consumerKey<-"xxxxxxxxxxxxxx"
consumerSecret<-"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
twitCred<-OAuthFactory$new(consumerKey=consumerKey, consumerSecret=consumerSecret,  requestURL=reqURL,  accessURL=accessURL, authURL=authURL)
download.file(url="http://curl.haxx.se/ca/cacert.pem",  destfile="cacert.pem")
twitCred$handshake(cainfo="cacert.pem")

To enable the connection, please direct your web browser to:
https://api.twitter.com/oauth.authorize?oauth_token=xxxxxxxxxxxxx
When complete, record the PIN given to you and provide it here:

The problem is that on using ROAuth, the web URL address generated by R (to get the PIN) redirects me to a webpage saying that “Sorry that page does not exist”.

Since I am testing my application, I used the IP address of my localhost appended with :1410 as my callback URL. I have used a similar protocol previously without errors and I don’t see any answers for this message. What am I doing wrong?


#2

As per suggestions, I put 1.1 in the URL to read https://api.twitter.com/1.1/oauth.authorize?oauth_token=xxxxxxxxxxxxx
Now the error that I get is “Bad authentication data”. Can someone decode this message for me?