1

在生成有效的令牌 URL 并且我输入了 PIN 之后,握手返回以下错误。

Error in cred$handshake() : Invalid response after authorization. You likely misentered your PIN, try rerunning this handshake & browser authorization to get a new PIN.

我已经三重检查了我没有输入错误的密码。在函数中放置一些打印表明“oauth_token_secret”不在 oauthPOST() 的响应中?

重现代码和我的系统配置文件如下。提前致谢。

library(twitteR);
library(tm);
library(wordcloud);
library(RColorBrewer);
library(ROAuth);
library(RCurl);
library(digest);

##consumer key
twit_consumer_key='XXXXXXXXXXXXXX';
##consumer secret
twit_consumer_secret='XXXXXXXXXXXXXXXXXX';
##request token URL
twit_request_url='https://api.twitter.com/oauth/request_token';
##access token URL
twit_access_url='https://api.twitter.com/oauth/access_token';
##authorize URL
twit_authorize_url='https://api.twitter.com/oauth/authorize';

cred <- OAuthFactory$new(consumerKey=twit_consumer_key,
                         consumerSecret=twit_consumer_secret,
                         requestURL=twit_request_url,
                         accessURL=twit_authorize_url,
                         authURL=twit_authorize_url);
cred$handshake();

以下是会话信息:

> sessionInfo()
R version 2.15.3 (2013-03-01)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8       
 [4] LC_COLLATE=en_GB.UTF-8     LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
 [7] LC_PAPER=C                 LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] digest_0.6.3       wordcloud_2.2      RColorBrewer_1.0-5 Rcpp_0.10.3        tm_0.5-8.3        
[6] twitteR_1.1.0      rjson_0.2.12       RCurl_1.95-4.1     bitops_1.0-5      

loaded via a namespace (and not attached):
[1] codetools_0.2-8 slam_0.1-28     tools_2.15.3
4

0 回答 0