OAuth Authentication with Twitter API via R failed!


#1

I used R’s packages ‘twitteR’ and ‘ROAuth’ to access Twitter API. I tried this R code to register my R session:

tw<-OAuthFactory$new(consumerKey=“mykeyhere”,consumerSecret=“mysecrethere”,
requestURL=“http://api.twitter.com/oauth/request_token”,
accessURL=“http://api.twitter.com/oauth/access_token”,
authURL=“http://api.twitter.com/oauth/authorize”)
tw<-handshake()

I used http instead of https because the latter gave me an error of SSL certification fail. Then, I enter a PIN code obtained from a given URL and registered with Twitter:

registerTwitterOAuth(tw)
The result of the above command was:

[1] TRUE
I think that I successfully registered using OAuth. However, when I tried to access protected users’ profiles, for example,

getURL(“http://api.twitter.com/1/followers/ids.json?cursor=-1&user_id=XXXXXXXX”)

I got this:

[1] “{“error”:“Not authorized”,“request”:”\/1\/followers\/ids.json?cursor=-1&user_id=XXXXXXXX"}"

I also checked my verification by using:

getURL(“http://api.twitter.com/1/account/verify_credentials.json”)

And this was the result:

[1] “{“error”:“Could not authenticate you.”,“request”:”\/1\/account\/verify_credentials.json"}"

Would you mind helping me please? Thank you very much.


#2

Well I certainly have no prior experience with R, so let me know if I’m completely off base, but from looking at the library documentation I found here: http://cran.r-project.org/web/packages/twitteR/twitteR.pdf

It appears that getURL isn’t a method in the library - are you sure that calling it is performing all of the appropriate OAuth signing?

Do the library methods work for you? For example, “getFollowerIDs”?


#3

Hi sorry bother i think someone keeps unfollowing who i follow and following. Olease could u veryify my account.i had problems for months and i think i know who. Please add a blue check to my profile thanks really appriciate it. Now i see when i reset who three are. Thanks for ur help.