【问题标题】:Access to Twitter Streaming APIs Using R using streamR & ROAuth使用 R 和 ROAuth 访问 Twitter 流 API
【发布时间】:2016-02-03 01:53:02
【问题描述】:

我正在尝试在 R 中连接到 Twitter 的 Streaming API。我的代码(包括伪造的消费者密钥和秘密)如下:

library(streamR)
library(ROAuth)
requestURL <- "https://api.twitter.com/oauth/request_token"
accessURL <- "http://api.twitter.com/oauth/access_token"
authURL <- "http://api.twitter.com/oauth/authorize"
consumerKey <- "xxxxxxxyyyyyyyyzzzzzzzz"
consumerSecret <- "xxxxxxxyyyyyyyyzzzzzzzz123123123123123"
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"))

当我输入此代码时,我收到以下消息(尽管我更改了网址):

To enable the connection, please direct your web browser to: 
http://api.twitter.com/oauth/authorize?oauth_token=xxxxxxxyyyyyyyyzzzzzzzz
When complete, record the PIN given to you and provide it here: 

接下来我在浏览器中看到以下屏幕:

我选择“授权应用程序”,然后导航离开 api.twitter.com。我从来没有看到前进所需的 PIN 码。

欢迎提出有关如何解决此问题(并检索我需要的 PIN 以启用我正在尝试创建的连接)的任何想法!

【问题讨论】:

    标签: r twitter oauth twitter-oauth roauth


    【解决方案1】:

    您只需将密码输入您的 RSStudio 控制台

    【讨论】:

      【解决方案2】:

      我删除了回调 URL,这解决了问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-06-11
        • 1970-01-01
        • 2020-05-04
        • 1970-01-01
        • 2015-03-06
        • 2011-12-26
        • 1970-01-01
        • 2013-09-02
        相关资源
        最近更新 更多