Permalink
Browse files

Update README to be more clear about status hook methods

  • Loading branch information...
1 parent 30930ab commit 364230ed0285a8059b681657ff946c241adb3ea9 @coreyhaines coreyhaines committed Sep 24, 2011
Showing with 14 additions and 4 deletions.
  1. +14 −4 README.md
View
@@ -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
----------------------------------

0 comments on commit 364230e

Please sign in to comment.