【问题标题】:extracting tweets without oauth在没有 oauth 的情况下提取推文
【发布时间】:2014-03-08 15:11:47
【问题描述】:

我尝试了各种 ruby​​ 代码来提取推文,我开始知道为了获取推文,我必须创建一个推特应用程序并使用 Oauth 来获取消费者密钥。我的问题是我不能在不使用 Oauth 的情况下访问公共推文,因为我正在从事一个必须分析推文的项目。 我试过的ruby代码如下

require 'tweetstream'
require 'rubygems'
TweetStream.configure do |config|
config.username = 'twitterusername'
config.password = 'twitterpassword'
config.auth_method = :basic
end
@client = TweetStream::Client.new
@client.sample do |status|
puts "#{status.text}"
end

我得到 Failed to reconnect to twitter 错误。

【问题讨论】:

    标签: ruby twitter oauth


    【解决方案1】:

    没有 Oauth 就无法访问 twitter api。您需要创建一个 twitter 应用程序才能从 API 请求此信息。

    您可以从这里开始阅读:Authentication & Authorization

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-12-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-02
      • 1970-01-01
      • 2014-06-23
      相关资源
      最近更新 更多