Kisakov
Kisakov

Reputation: 51

gem TweetStream change user_ids dynamically

How after this code change user_ids dynamically?

TweetStream::Client.new.follow(14252, 53235) do |status|
    puts "#{status.text}"
end

For example I start TweetStream with user_ids from DB, but after that I have a new one user_id. How add a new user_id to the follow array?

Thank you!

Upvotes: 0

Views: 76

Answers (1)

anton-z
anton-z

Reputation: 104

before you need to make your code more flexible

client = TweetStream::Client.new

next

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

and do something like this:

client.control.add_user('2039761')
client.control.remove_user('115192457')

but you will need to use Eventmachine or something else for this code

Upvotes: 1

Related Questions