2

当我尝试为 twitteR 设置 OAuth 授权时,我反复收到以下 setup_twitter_oauth() 错误

> setup_twitter_oauth("XXXXXXXXXX", "XXXXXXXXX", "XXXXXX", "XXXXXXXX")
[1] "Using direct authentication"
Error in check_twitter_oauth() : OAuth authentication error:
This most likely means that you have incorrectly called setup_twitter_oauth()'

如果有人可以在这个问题上提供帮助,真的会很感激吗?

我在 Github 上看到了 JeffGentry 的这篇有用的帖子,但是安装 twitteR_1.1.8 会自动安装 httr_0.6.1 而不是 httr_0.6.0

check_twitter_oauth() 中的错误:OAuth 身份验证错误:#67

我尝试删除默认的 httr_0.6.1 包并从下面的链接下载并安装 httr_0.6.0 但没有运气。它给了我以下错误:

> install.packages("http://ftp.iitm.ac.in/cran/src/contrib/Archive/httr/httr_0.6.0.tar.gz", repos=NULL, type="source")
Installing package into ‘C:/Users/SO310400/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://ftp.iitm.ac.in/cran/src/contrib/Archive/httr/httr_0.6.0.tar.gz'
Content type 'application/x-gzip' length 247298 bytes (241 Kb)
opened URL
downloaded 241 Kb

* installing *source* package 'httr' ...
** package 'httr' successfully unpacked and MD5 sums checked
** libs
Warning: running command 'make -f "C:/Users/SO310400/R/R-3.1.2/etc/i386/Makeconf" -f "C:/Users/SO310400/R/R-3.1.2/share/make/winshlib.mk" SHLIB="httr.dll" OBJECTS="writer.o"' had status 127
ERROR: compilation failed for package 'httr'
* removing 'C:/Users/SO310400/Documents/R/win-library/3.1/httr'
Warning in install.packages :
  running command '"C:/Users/SO310400/R/R-3.1.2/bin/i386/R" CMD INSTALL -l "C:\Users\SO310400\Documents\R\win-library\3.1" "C:/Users/SO310400/AppData/Local/Temp/RtmpeMm13f/downloaded_packages/httr_0.6.0.tar.gz"' had status 1
Warning in install.packages :
  installation of package ‘C:/Users/SO310400/AppData/Local/Temp/RtmpeMm13f/downloaded_packages/httr_0.6.0.tar.gz’ had non-zero exit status

任何有见地的帮助都将受到赞赏和奖励!

4

2 回答 2

0

安装 httr v0.6.1 后,您可能需要重新启动 r-session。

我有同样的问题。使用 twitteR 1.1.8 安装 httr v0.6.1,然后重新启动我的 r-session 使其正常工作。

祝你好运!

于 2015-06-26T12:05:36.227 回答
0

我有同样的问题。

在您的应用程序的权限选项中,您需要更改为“读取、写入和访问直接消息”

library("twitteR")
library("bitops")
library("RCurl")

api_key <- your api_key "
api_secret <- "api_secret"
access_token <- "access_token"
access_token_secret <- "access_token_secret"

setup_twitter_oauth(api_key, api_secret, access_token, access_token_secret)

datascients_tweets <- searchTwitter("datascience", n=1000, lang ="en")

笔记。我做的另一件事是激活国际空间站的功能。我不知道这是否有助于解决问题并禁用防火墙。

于 2018-05-20T02:20:34.393 回答