Skip to content

Instantly share code, notes, and snippets.

@Mahito
Created July 17, 2012 16:29
Show Gist options
  • Save Mahito/3130456 to your computer and use it in GitHub Desktop.
Save Mahito/3130456 to your computer and use it in GitHub Desktop.
TweetStreamを使ったTwitter Streaming APIの利用方法サンプル
require 'tweetstream'
require 'yaml'
CONF = YAML::load(open("conf.yaml"))
TweetStream.configure do |config|
config.consumer_key = CONF["consumer_key"]
config.consumer_secret = CONF["consumer_secret"]
config.oauth_token = CONF["token"]
config.oauth_token_secret = CONF["token_secret"]
config.auth_method = :oauth
end
TweetStream::Client.new.track('Ruby') do |status|
puts status.text
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment