Sha256: 94292437d7d323d0ac9e2c247093f0c062cd69a882fa022a968eeb6d097b6c1e

Contents?: true

Size: 881 Bytes

Versions: 5

Compression:

Stored size: 881 Bytes

Contents

require 'yajl'
require 'tweetstream'

TweetStream.configure do |config|
  config.consumer_key       = 'abcdefghijklmnopqrstuvwxyz'
  config.consumer_secret    = '0123456789'
  config.oauth_token        = 'abcdefghijklmnopqrstuvwxyz'
  config.oauth_token_secret = '0123456789'
  config.auth_method        = :oauth
end

EM.run do

  client = TweetStream::Client.new

  client.on_error do |error|
    puts error
  end

  client.sitestream([user_id], :followings => true) do |status|
    puts status.inspect
  end

  EM::Timer.new(60) do
    client.control.add_user(user_id_to_add)
    client.control.info { |i| puts i.inspect }
  end

  EM::Timer.new(75) do
    client.control.friends_ids(user_id) do |friends|
      puts friends.inspect
    end
  end

  EM::Timer.new(90) do
    client.control.remove_user(user_id_to_remove)
    client.control.info { |i| puts i.inspect }
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tweetstream-2.3.0 examples/sitestream.rb
tweetstream-2.2.0 examples/sitestream.rb
tweetstream-2.1.0 examples/sitestream.rb
tweetstream-2.0.1 examples/sitestream.rb
tweetstream-2.0.0 examples/sitestream.rb