Class: Tweeb::Stream
- Inherits:
-
Object
- Object
- Tweeb::Stream
- Defined in:
- lib/tweeb_stream.rb
Instance Method Summary collapse
-
#initialize(username, password) ⇒ Stream
constructor
A new instance of Stream.
- #spritzer(&block) ⇒ Object
Constructor Details
#initialize(username, password) ⇒ Stream
Returns a new instance of Stream.
8 9 10 11 12 |
# File 'lib/tweeb_stream.rb', line 8 def initialize(username, password) @username = username @password = password @url = URI.parse("http://#{@username}:#{@password}@stream.twitter.com") end |
Instance Method Details
#spritzer(&block) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/tweeb_stream.rb', line 14 def spritzer(&block) @url.path = "/spritzer.json" Yajl::HttpStream.get(@url, :symbolize_keys => true) do |json| block.call(json) end end |