【发布时间】:2016-05-24 12:45:51
【问题描述】:
我做了所有的步骤
> library(ROAuth)
> reqURL <- "https://api.twitter.com/oauth/request_token"
> accessURL <- "http://api.twitter.com/oauth/access_token"
> authURL <- "http://api.twitter.com/oauth/authorize"
> consumerKey <- "xxxxxxxxxxxxxxx"
> consumerSecret <- "xxxxxxxxxxxxxxx"
> 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=gYBR6Z2pg2YExfMjAsNp8QmjkSwpwfa5nPQNtUdgMWw
When complete, record the PIN given to you and provide it here: registerTwitterOAuth(twitCred)
Error: Forbidden
我粘贴了我的密码
> xyxabcd
它给出了: [1] xyxabcd
我输入了我的查询
> delta.tweets = searchTwitter('@abcdx', n=1500)
但它又给出了这个错误。
Error in twInterfaceObj$doAPICall(cmd, params, "GET", ...) :
OAuth authentication is required with Twitter's API v1.1
【问题讨论】:
-
看看
twitteR和httr包,也许这些更容易使用
标签: r twitter-oauth