Class: Tweeb::Stream

Inherits:
Object
  • Object
show all
Defined in:
lib/tweeb_stream.rb

Instance Method Summary collapse

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