Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added userstream example h/t @coreyhaines

  • Loading branch information...
commit 4beed8310eb83b7b64d7a24cc7ff4fcebbc7dbbf 1 parent 0abfe33
@stve stve authored
Showing with 27 additions and 0 deletions.
  1. +27 −0 examples/userstream.rb
View
27 examples/userstream.rb
@@ -0,0 +1,27 @@
+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
+ config.parser = :yajl
+end
+
+client = TweetStream::Client.new
+
+client.on_error do |message|
+ puts message
+end
+
+client.on_direct_message do |direct_message|
+ puts direct_message.text
+end
+
+client.on_timeline_status do |status|
+ puts status.text
+end
+
+client.userstream
Please sign in to comment.
Something went wrong with that request. Please try again.