回复 第2楼 的 肖楠:你好,我也在用TwitteR包分析twitter数据~
我是通过****翻墙的~
建立OAuth类的代码及运行结果如下:
> library(bitops)
> library(RCurl)
> library(rjson)
> library(twitteR)
> library(ROAuth)
> library(digest)
> reqURL<-"https://api.twitter.com/oauth/request_token"
> accessURL<-"http://api.twitter.com/oauth/access_token"
> authURL<-"http://api.twitter.com/oauth/authorize"
> consumerKey<-"orZF0ZM0IlYJDJXS9Bio4Q"
> consumerSecret<-"3yGcP1a8ZPjhT0P4VnDFn8israfsd2VyGHcmocbo"
> twitCred<-OAuthFactory$new(consumerKey=consumerKey,
+ consumerSecret=consumerSecret,
+ requestURL=reqURL,
+ authURL=authURL)
> twitCred$handshake()
Error in function (type, msg, asError = TRUE) : couldn't connect to host
> registerTwitterOAuth(twitCred)
Error in registerTwitterOAuth(twitCred) :
oauth has not completed its handshake
> 有两个错误,您能帮忙分析是什么原因吗?谢谢!