Sha256: ed2fdc15903fb12bd53917796b61f41fb9141cef46b598f630738a4bef2b5f47
Contents?: true
Size: 1.06 KB
Versions: 7
Compression:
Stored size: 1.06 KB
Contents
require 'bundler/setup' require 'em-twitter' EM::run do options = { :path => '/1/statuses/filter.json', :params => { :track => 'yankees' }, :oauth => { :consumer_key => ENV['CONSUMER_KEY'], :consumer_secret => ENV['CONSUMER_SECRET'], :token => ENV['OAUTH_TOKEN'], :token_secret => ENV['OAUTH_TOKEN_SECRET'] } } client = EM::Twitter::Client.connect(options) client.each do |result| puts result end client.on_error do |message| puts "oops: error: #{message}" end client.on_unauthorized do puts "oops: unauthorized" end client.on_forbidden do puts "oops: unauthorized" end client.on_not_found do puts "oops: not_found" end client.on_not_acceptable do puts "oops: not_acceptable" end client.on_too_long do puts "oops: too_long" end client.on_range_unacceptable do puts "oops: range_unacceptable" end client.on_enhance_your_calm do puts "oops: enhance_your_calm" end EM.add_timer(10) do EM.stop end end
Version data entries
7 entries across 7 versions & 1 rubygems