読者です 読者をやめる 読者になる 読者になる

by shigemk2

当面は技術的なことしか書かない

ハッシュタグのツイートを引っ張り上げる

Ruby
#!/bin/env ruby
# encoding:UTF-8
require "twitter"

client = Twitter::REST::Client.new do |config|
  config.consumer_key        = "" #
  config.consumer_secret     = "" #
  config.access_token        = "" #
  config.access_token_secret = "" #
end

tag = "#"+"#{ARGV[0]}"

# result_typeはrecentかpopular
client.search(tag, :result_type => "recent").collect do |tweet|
  if ((Time.now - 60 < tweet.created_at) && (tweet.created_at < Time.now))
    puts '#{tweet.url}'
    puts '#{tweet.text}'
  end
end