gpt4 book ai didi

r - 在 R 中使用 twitteR 时出现 oauth 握手错误

转载 作者:行者123 更新时间:2023-12-02 02:54:57 24 4
gpt4 key购买 nike

我一直在尝试使用 R 中的 tweeteR 包下载一些推文

我的 oauth 凭据的代码是

cred<-AuthFactory$new(consumerKey=consumerKey,
consumerSecret=consumerSecret,requestURL=reqURL,accessURL=accessURL,authURL=authURL)

当我尝试运行以下握手时

cred$handshake(cainfo=system.file("CurlSSL","cacert.pem",package="RCurl"))

我收到此错误

Error in function (type, msg, asError = TRUE)  : 
Could not resolve host: api.twitter.com; No data record of requested type

我正在 Windows 机器上运行代码。 (我已经包含了下载cacert.pem的代码)

最佳答案

我为此找到了解决方案,对于使用代理的人来说,他们也必须在 RCurl 中设置代理选项(为 R 设置代理是不够的)。该命令有效

options( RCurlOptions = list(verbose = TRUE,proxy = "host:port"))

关于r - 在 R 中使用 twitteR 时出现 oauth 握手错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24104179/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com