Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Twitter的ROAuth握手错误(Twitter API 443)_R_Twitter - Fatal编程技术网

使用Twitter的ROAuth握手错误(Twitter API 443)

使用Twitter的ROAuth握手错误(Twitter API 443),r,twitter,R,Twitter,我正试图通过R访问Twitter API,我的代码在“握手”时被破坏了——其他一切(以及不需要握手的后续代码)都能正常工作。类似地,我让一位朋友在她的计算机上尝试了相同的代码(以及我的OAuth信息),这是成功的 requestURL <- "https://api.twitter.com/oauth/request_token" accessURL <- "https://api.twitter.com/oauth/access_token" authURL <- "http

我正试图通过R访问Twitter API,我的代码在“握手”时被破坏了——其他一切(以及不需要握手的后续代码)都能正常工作。类似地,我让一位朋友在她的计算机上尝试了相同的代码(以及我的OAuth信息),这是成功的

requestURL <- "https://api.twitter.com/oauth/request_token"
accessURL <- "https://api.twitter.com/oauth/access_token"
authURL <- "https://api.twitter.com/oauth/authorize"
consumerKey <- "X"
consumerSecret <- "Y"
my_oauth <- OAuthFactory$new(consumerKey=consumerKey, consumerSecret=consumerSecret, 
    requestURL=requestURL, accessURL=accessURL, authURL=authURL)

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

save(my_oauth, file = 'Twitter_TokenNFH')
load('Twitter_TokenNFH')

我对tweetscores库也有同样的问题。每次握手都不起作用

经过长时间的努力,解决方案是在Linux中安装R和RStudio。每台装有Windows的计算机,软件包都会出现协议问题

在Windows10中,有一种不用虚拟机或双启动的方式来使用Linux。只需尝试使用WSL2、安装Linux版本、下载GUI界面并安装R和RStudio

我希望这对你也有用

一些帮助我安装OS和R的教程:

我对tweetscores库也有同样的问题。每次握手都不起作用

经过长时间的努力,解决方案是在Linux中安装R和RStudio。每台装有Windows的计算机,软件包都会出现协议问题

在Windows10中,有一种不用虚拟机或双启动的方式来使用Linux。只需尝试使用WSL2、安装Linux版本、下载GUI界面并安装R和RStudio

我希望这对你也有用

一些帮助我安装OS和R的教程:

你好,帕洛玛!非常感谢。事实上,我刚买了一台Mac电脑,现在可以用了。同样的决心。嗨,帕洛玛!非常感谢。事实上,我刚买了一台Mac电脑,现在可以用了。同样的决心。
Session info ---------------------------------------------------------------
 setting  value                       
 version  R version 3.6.2 (2019-12-12)
 os       Windows 10 x64              
 system   x86_64, mingw32             
 ui       RStudio                     
 language (EN)                        
 collate  English_United States.1252  
 ctype    English_United States.1252  
 tz       America/Los_Angeles         
 date     2020-01-17                  

- Packages -------------------------------------------------------------------
 package     * version   date       lib
 assertthat    0.2.1     2019-03-21 [1]
 backports     1.1.5     2019-10-02 [1]
 bit           1.1-15.1  2020-01-14 [1]
 bit64         0.9-7     2017-05-08 [1]
 bitops      * 1.0-6     2013-08-17 [1]
 boot        * 1.3-24    2019-12-20 [2]
 callr         3.4.0     2019-12-09 [1]
 cli           2.0.1     2020-01-08 [1]
 coda        * 0.19-3    2019-07-05 [1]
 colorspace    1.4-1     2019-03-18 [1]
 crayon        1.3.4     2017-09-16 [1]
 DBI           1.1.0     2019-12-15 [1]
 desc          1.2.0     2018-05-01 [1]
 devtools    * 2.2.1     2019-09-24 [1]
 digest        0.6.23    2019-11-23 [1]
 dplyr         0.8.3     2019-07-04 [1]
 ellipsis      0.3.0     2019-09-20 [1]
 fansi         0.4.1     2020-01-08 [1]
 fs            1.3.1     2019-05-06 [1]
 ggplot2       3.2.1     2019-08-10 [1]
 glue          1.3.1     2019-03-12 [1]
 gtable        0.3.0     2019-03-25 [1]
 httr          1.4.1     2019-08-05 [1]
 igraph      * 1.2.4.2   2019-11-27 [1]
 jsonlite      1.6       2018-12-07 [1]
 knitr         1.26      2019-11-12 [1]
 lattice       0.20-38   2018-11-04 [2]
 lazyeval      0.2.2     2019-03-15 [1]
 lifecycle     0.1.0     2019-08-01 [1]
 magrittr      1.5       2014-11-22 [1]
 memoise       1.1.0     2017-04-21 [1]
 munsell       0.5.0     2018-06-12 [1]
 ndjson      * 0.8.0     2019-11-13 [1]
 pillar        1.4.3     2019-12-20 [1]
 pkgbuild      1.0.6     2019-10-09 [1]
 pkgconfig     2.0.3     2019-09-22 [1]
 pkgload       1.0.2     2018-10-29 [1]
 prettyunits   1.1.0     2020-01-09 [1]
 processx      3.4.1     2019-07-18 [1]
 ps            1.3.0     2018-12-21 [1]
 purrr         0.3.3     2019-10-18 [1]
 R2WinBUGS   * 2.1-21    2015-07-30 [1]
 R6            2.4.1     2019-11-12 [1]
 Rcpp          1.0.3     2019-11-08 [1]
 RCurl       * 1.95-4.12 2019-03-04 [1]
 remotes       2.1.0     2019-06-24 [1]
 rjson       * 0.2.20    2018-06-08 [1]
 rlang         0.4.2     2019-11-23 [1]
 ROAuth      * 0.9.6     2015-02-13 [1]
 rprojroot     1.3-2     2018-01-03 [1]
 rstudioapi    0.10      2019-03-19 [1]
 rtweet      * 0.7.0     2020-01-08 [1]
 scales        1.1.0     2019-11-18 [1]
 sessioninfo   1.1.1     2018-11-05 [1]
 streamR     * 0.4.5     2018-12-09 [1]
 testthat      2.3.1     2019-12-01 [1]
 tibble        2.1.3     2019-06-06 [1]
 tidyselect    0.2.5     2018-10-11 [1]
 tweetscores * 0.2.1     2020-01-16 [1]
 twitteR     * 1.1.9     2015-07-29 [1]
 usethis     * 1.5.1     2019-07-04 [1]
 withr         2.1.2     2018-03-15 [1]
 xfun          0.12      2020-01-13 [1]
 yaml          2.2.0     2018-07-25 [1]