Skip to content
This repository

Twitter realtime API client

tree: 11ce705f70

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 examples
Octocat-spinner-32 fixtures
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 README.markdown
Octocat-spinner-32 Rakefile
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.

Usage

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|
    # log or something
  end
}

Examples

Open examples/reader.rb. Replace LOGIN:PASSWORD with your real twitter login and password. And ruby examples/reader.rb

Something went wrong with that request. Please try again.