twitteR OAuth handshake Error: Forbidden (Mac OS)

59 Views Asked by At

I tried to follow the simple example in R's twitteR package to connect to Twitter. I created an App, obtained customer key and secret. I call the twitCred$handshake(), get a URL, Authorize the App and get a pin. So far so good. But when I enter the pin, I always get Error: Forbidden.

Any help apprechiated!!

Here is my session info:

> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-apple-darwin13.1.0 (64-bit)

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] twitteR_1.1.7  rjson_0.2.13   ROAuth_0.9.3   digest_0.6.4   RCurl_1.95-4.1 bitops_1.0-6  

loaded via a namespace (and not attached):
[1] tools_3.1.0

This is the code:

library(twitteR)
library(ROAuth)

## A real example, but using a fictitious consumerkey and consumer
## secret - you’ll need to supply your own
reqURL <- "https://api.twitter.com/oauth/request_token"
accessURL <- "http://api.twitter.com/oauth/access_token"
authURL <- "http://api.twitter.com/oauth/authorize"
consumerKey <- "..."
consumerSecret <- "..."
twitCred <- OAuthFactory$new(consumerKey=consumerKey,
                             consumerSecret=consumerSecret,
                             requestURL=reqURL,
                             accessURL=accessURL,
                             authURL=authURL)
twitCred$handshake()

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

There are 0 best solutions below