Skip to content

Commit

Permalink
Update README to be more clear about status hook methods
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyhaines committed Sep 24, 2011
1 parent 30930ab commit 364230e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions README.md
Expand Up @@ -54,20 +54,30 @@ with the methods available on the Streaming API wiki page.
Using the Twitter Userstream
----------------------------

Using the Twitter userstream works similarly to the regular usage, except you use the userstream method.
Using the Twitter userstream works similarly to the regular streaming, except you use the userstream method.

# Use 'userstream' to get message from your stream
TweetStream::Client.new.userstream do |status|
puts "#{status.text}"
puts status.text
end

You also can listen to direct messages by supplying an on_direct_message proc

You also can use method hooks for both regular timeline statuses and direct messages.

client = TweetStream::Client.new

client.on_direct_message do |direct_message|
puts "#{direct_message.text}"
puts "direct message"
puts direct_message.text
end

client.on_timeline_status do |status|
puts "timeline status"
puts status.text
end

client.userstream

Configuration and Changes in 1.1.0
----------------------------------

Expand Down

0 comments on commit 364230e

Please sign in to comment.