代码:
TwitterOAuth<-function(){
reqURL <- "https://api.twitter.com/oauth/request_token"
accessURL <- "http://api.twitter.com/oauth/access_token"
authURL <- "http://api.twitter.com/oauth/authorize"
consumerKey <- "xxxxxxxxxxxxxxxx"
consumerSecret <- "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
twitCred <- OAuthFactory$new(consumerKey=consumerKey,
consumerSecret=consumerSecret,
requestURL=reqURL,
accessURL=accessURL,
authURL=authURL)
options(RCurlOptions = list(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl")))
twitCred$handshake()
registerTwitterOAuth(twitCred)
}
响应:
TwitterOAuth() 要建立连接,请将您的网络浏览器指向: http://api.twitter.com/oauth/authorize?oauth_token=X0AwET4FXBC7YRIWWN3iF61WFNE1DjxbfibqtfFjgcc
完成后,请记录给您的PIN并在此处提供:1998913
错误:禁止访问
我的sessionInfo()
R版本3.0.2(2013-09-25) 平台:x86_64-w64-mingw32 / x64(64位)
语言环境: [1] LC_COLLATE = Turkish_Turkey.1254 LC_CTYPE = Turkish_Turkey.1254 LC_MONETARY = Turkish_Turkey.1254 [4] LC_NUMERIC = C LC_TIME = Turkish_Turkey.1254
附加的基本包: [1] stats graphics grDevices utils datasets methods base
其他附加的包: [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
通过名称空间加载(未附加): [1] tools_3.0.2