我正在尝试使用R从twitter中提取推文。在建立与twitter API的连接时,我收到以下身份验证错误:
> setup_twitter_oauth(api_key, api_secret, token, token_secret)
[1] "Using direct authentication"
Error in check_twitter_oauth() : OAuth authentication error:
This most likely means that you have incorrectly called setup_twitter_oauth()'
这是我正在使用的代码:
api_key <- "api_key here"
api_secret <- "api_secret here"
access_token <- "access_token here"
access_token_secret <- "access_token_secret here "
setup_twitter_oauth(api_key,api_secret,access_token,access_token_secret)
我的R会话是:
Session info
------------------------------------------------
setting value
version R version 3.2.2 (2015-08-14)
system x86_64, linux-gnu
ui RStudio (0.99.489)
language (EN)
collate en_US.UTF-8
tz <NA>
date 2016-01-19
我尝试重新生成访问权限和令牌密钥,创建新应用,更新回调网址但仍然无法解决我的问题。
正如所建议的那样,我已将httr和twitteR软件包更新到最新版本,但我仍然收到错误。
请找到以下我得到的错误:
> setup_twitter_oauth(api_key, api_secret, token, token_secret)
[1] "Using direct authentication"
Use a local file to cache OAuth access credentials between R sessions?
1: Yes
2: No
Selection: 1
Adding .httr-oauth to .gitignore
Error in file(con, "w") : cannot open the connection
In addition: Warning message:
In file(con, "w") : cannot open file '.gitignore': Permission denied
> setup_twitter_oauth(api_key, api_secret, token, token_secret)
[1] "Using direct authentication"
Use a local file to cache OAuth access credentials between R sessions?
1: Yes
2: No
Selection: 2
Error in check_twitter_oauth() : OAuth authentication error:
This most likely means that you have incorrectly called setup_twitter_oauth()'
请提供您的建议。
由于