简体   繁体   中英

How do I get Twitter follow request with the Tweetstream Ruby gem?

According to this Ars Technica tutorial, "the streaming API makes it easy to detect when the user gets a new follower. To detect follow event objects, look for the "event" key and check if it has the string "follow" as the value."

http://arstechnica.com/information-technology/2010/04/tutorial-use-twitters-new-real-time-stream-api-in-python/2/

The tweetstream gem supposedly exposes all methods from the API. However I can't figure out, how to get to those follow requests!

Any ideas?

The tweetstream gem is fairly complete, but sometimes you need to delve into the source to find stuff:

client.on_event(:follow) do |event|
  p event[:source][:screen_name]
end

https://github.com/intridea/tweetstream/blob/master/lib/tweetstream/client.rb#L375 :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM