0

I would like to use twitteR and am trying to get my pin number so that I can complete the authorization. There appears to be no error in the code:

library(twitteR)
reqURL<-"https://api.twitter.com/oauth/request_token"
accessURL<-"https://api.twitter.com/oauth/access_token"
authURL<-"https://api.twitter.com/oauth.authorize"
consumerKey<-"MyKey"
consumerSecret<-"MySecret"
twitCred<-OAuthFactory$new(consumerKey=consumerKey, 
                   consumerSecret=consumerSecret, 
                   requestURL=reqURL,
                   accessURL=accessURL,
                   authURL=authURL)
twitCred$handshake()

I receive the URL to type in a web browser:https://api.twitter.com/oauth.authorize?oauth_token=LettersaNdNumbErs

but I get a twitter page saying that page doesn't exist! I've tried with and without the "s" in https:// but I get the same result. Any ideas what I could be doing wrong? I am using a mac with JGR (you can copy and paste the URL) and RStudio (have to type URL by hand, so to speak).

StarkJA
  • 75
  • 1
  • 5
  • Possibly relevant: http://stackoverflow.com/questions/18496345/rstudio-on-a-server-roauth-no-longer-used-in-favor-of-httr-twitter-api – Stedy Nov 24 '13 at 06:44
  • Thank you, Stedy, but I did not find that helpful. The error is different from the one I am experiencing described above. – StarkJA Nov 25 '13 at 01:19

2 Answers2

1

You accidentally put a dot instead of a slash, try this instead:

authURL <- https://api.twitter.com/oauth/authorize

And that should bring up the link to the twitter developer page to authorize your application

Stedy
  • 7,359
  • 14
  • 57
  • 77
0

I had a similar problem. I couldn't copy the link from RStudio because I couldn't select the text below the last completed prompt. The issue was that the token had expired by the time I'd retyped the URL.

I solved it by using the basic R gui instead, which let me copy and paste - worked fine.

Troy
  • 8,581
  • 29
  • 32