0

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
Sylvia
  • 315
  • 2
  • 17
  • 1
    I saw the post but changing http to https doesn't do the trick for me. Also, I am working on a Mac.. – Sylvia Apr 23 '14 at 20:04
  • Can you update your post to capture that you've used https? It looks like it was `accessURL` that needed to be updated to `https`. – josliber Apr 23 '14 at 20:19
  • I tried once more with https and not it does work! I think the one time I tried with the 's' before I made a mistake typing the authentication key! Sorry, I guess - problem solved :) – Sylvia Apr 23 '14 at 21:42
  • should I delete my initial question? – Sylvia Apr 23 '14 at 21:43
  • Glad you got it cleared up! It's up to you if you want to delete the question -- there seems to be [some sentiment](http://meta.stackexchange.com/questions/32311/do-not-delete-good-duplicates) that duplicate questions are good to keep around, because they point web searchers to the questions with the correct answer. – josliber Apr 23 '14 at 21:53
  • ok, so I will keep it there. Thanks a lot josilber! – Sylvia Apr 23 '14 at 22:07

0 Answers0