Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A Ruby gem for Twitter's new Streaming API codename Hosebird
Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib
test
.document
.gitignore
LICENSE
README.textile
Rakefile
VERSION
hosebird.gemspec

README.textile

hosebird

Overview

Hosebird is a Ruby library for Twitter’s new Streaming API codename Hosebird. Hosebird will open a persistent HTTP connection which receives updates in near-realtime.

For example, hosebird makes it easy to monitor twitter for caps lock abuse.


require 'hosebird' username, password = #... twitter = Twitter::Base.new(Twitter::HTTPAuth.new(username, password))

Hosebird::Spritzer.subscribe(twitter) do |status|
if status[:text].upcase == status[:text] && status[:text] =~ /\w+/
twitter.update(“@#{status[:user][:screen_name]} ur caps r on, btw”, :in_reply_to_status_id => status[:id])
end
end

Installation

Requirements

Optional

Installing from GitHub

sudo gem install benburkert-hosebird

Examples

Growlr: A Realtime Twitter Client

Note: Requires OSX with Growl

1. Create a ~/.twitter YAML file with your twitter username & password:
</code>
echo "username: oprah
password: harpo" > ~/.twitter

2. Checkout the hosebird source:

git clone git://github.com/benburkert/hosebird.git

3. Run the growler example:

ruby hosebird/examples/growlr.rb

Spritzr: Same as Growlr, but for the Public Timeline

Run hosebird/examples/spritzr.rb instead of hosebird/examples/growlr.rb.

Something went wrong with that request. Please try again.