This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Sun Oct 11 05:48:16 -0700 2009 | |
| |
README.markdown | Sun Oct 11 06:04:10 -0700 2009 | |
| |
Rakefile | Wed Oct 14 01:42:28 -0700 2009 | |
| |
VERSION | Tue Dec 01 09:14:15 -0800 2009 | |
| |
examples/ | Sun Oct 11 05:35:24 -0700 2009 | |
| |
fixtures/ | Fri Oct 09 02:54:44 -0700 2009 | |
| |
lib/ | Wed Dec 02 18:23:07 -0800 2009 | |
| |
spec/ | Sun Oct 11 05:22:53 -0700 2009 | |
| |
twitter-stream.gemspec | Wed Oct 14 01:42:28 -0700 2009 |
README.markdown
twitter-stream
Simple Ruby client library for twitter streaming API. Uses EventMachine for connection handling. Adheres to twitter's reconnection guidline.
JSON format only.
Install
sudo gem install twitter-stream -s http://gemcutter.org
Usage
require 'rubygems'
require 'twitter/json_stream'
EventMachine::run {
stream = Twitter::JSONStream.connect(
:path => '/1/statuses/filter.json?track=football',
:auth => 'LOGIN:PASSWORD'
)
stream.each_item do |item|
# Do someting with unparsed JSON item.
end
stream.on_error do |message|
# No need to worry here. It might be an issue with Twitter.
# Log message for future reference. JSONStream will try to reconnect after a timeout.
end
stream.on_max_reconnects do |timeout, retries|
# Something is wrong on your side. Send yourself an email.
end
}
Examples
Open examples/reader.rb. Replace LOGIN:PASSWORD with your real twitter login and password. And
ruby examples/reader.rb







