No commit activity in last 3 years
No release in over 3 years
A libary for Twitter's new Streaming API codename Hosebird.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

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.