Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/83.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
R 如果I';我是唯一的用户?_R_Twitter_Oauth_Twitter Oauth_Roauth - Fatal编程技术网

R 如果I';我是唯一的用户?

R 如果I';我是唯一的用户?,r,twitter,oauth,twitter-oauth,roauth,R,Twitter,Oauth,Twitter Oauth,Roauth,问题:有没有办法避免在进行OAuth握手时手动输入PIN码 上下文:在进行ROAuth握手时,我被要求输入一个PIN码,该PIN码是通过以下链接获得的: rm(list=ls()) library("twitteR") library("ROAuth") Credentials <- OAuthFactory$new( consumerKey = "...", consumerSecret = "...", oauthKey = "...", oauthSecret =

问题:有没有办法避免在进行OAuth握手时手动输入PIN码

上下文:在进行ROAuth握手时,我被要求输入一个PIN码,该PIN码是通过以下链接获得的:

rm(list=ls())
library("twitteR")
library("ROAuth")

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

Credentials$handshake(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl"))
rm(list=ls())
图书馆(“推特”)
图书馆(“ROAuth”)

凭据执行握手后,可以将对象保存到文件中

save(Credentials, file="credentials.RData")
稍后,您可以使用load()将文件拉入并使用原始凭据对象