An EventMachine-based client for http://chirpstream.twitter.com.
Ruby
Latest commit b49985b Sep 16, 2010 Joshua Hull added gitignore, Gemfile.lock
Permalink
Failed to load latest commit information.
bin added unfav. prefix event handlers with on_ May 21, 2010
image happy new icon May 1, 2010
lib fixed reference to users, avoid spinning multiple timers Jul 12, 2010
.gitignore added gitignore, Gemfile.lock Sep 16, 2010
Gemfile
Gemfile.lock added gitignore, Gemfile.lock Sep 16, 2010
Rakefile added fill_in option. correct specs May 20, 2010
Readme.rdoc added unfav. prefix event handlers with on_ May 21, 2010
VERSION Version bump to 0.1.0 May 21, 2010
chirpstream.gemspec

Readme.rdoc

Chirpstream

About

This is an experimental EventMachine-based client for chirpstream.twitter.com.

Fun Things You Can Do At Home

Fire up the growl client!

sudo gem install chirpstream
chirp_growl

Wow! It's growling my tweets! How meta.

Usage

require 'rubygems'
require 'chirpstream'
require 'rainbow'

chirp = Chirpstream.new
chirp.on_reconnect{ puts "reconnecting..." }
chirp.on_tweet {|t, u| puts "#{t.text} (from #{t.user.name.foreground(:red)} (#{('@' + t.user.screen_name).foreground(:green)}))" }
chirp.on_follow {|t, u| puts "#{t.source.screen_name.foreground(:green)} following #{t.target.screen_name.foreground(:green)}" }
chirp.on_favorite {|t, u| puts "#{t.source.screen_name.foreground(:green)} <3 -> #{t.target_object.text}" }
chirp.on_retweet {|t, u| puts "#{t.source.screen_name.foreground(:green)} RT -> #{t.target_object.text}" }
chirp.on_direct_message {|t, u| puts "DM : #{t.text} (from #{t.sender.name.foreground(:red)} (#{('@' + t.sender.screen_name).foreground(:green)}))" }
chirp.connect(Chirpstream::Connect::User.basic('joshbuddy', 'xxxxxxxx'))

Oauth Usage

chirp = Chirpstream.oauth(consumer_token, consumer_secret)
chirp.on_reconnect{ puts "reconnecting..." }
chirp.on_tweet {|t, u| puts "#{t.text} (from #{t.user.name.foreground(:red)} (#{('@' + t.user.screen_name).foreground(:green)}))" }
chirp.on_follow {|t, u| puts "#{t.source.screen_name.foreground(:green)} following #{t.target.screen_name.foreground(:green)}" }
chirp.on_favorite {|t, u| puts "#{t.source.screen_name.foreground(:green)} <3 -> #{t.target_object.text}" }
chirp.on_retweet {|t, u| puts "#{t.source.screen_name.foreground(:green)} RT -> #{t.target_object.text}" }
chirp.on_direct_message {|t, u| puts "DM : #{t.text} (from #{t.sender.name.foreground(:red)} (#{('@' + t.sender.screen_name).foreground(:green)}))" }
chirp.connect(Chirpstream::Connect::User.oauth(access_token, access_secret))

Multi User Usage

chirp = Chirpstream.new(consumer_token, consumer_secret)

chirp.on_reconnect{ puts "reconnecting..." }
chirp.on_tweet {|t, u| puts "#{t.text} (from #{t.user.name.foreground(:red)} (#{('@' + t.user.screen_name).foreground(:green)}))" }
chirp.on_follow {|t, u| puts "#{t.source.screen_name.foreground(:green)} following #{t.target.screen_name.foreground(:green)}" }
chirp.on_favorite {|t, u| puts "#{t.source.screen_name.foreground(:green)} <3 -> #{t.target_object.text}" }
chirp.on_retweet {|t, u| puts "#{t.source.screen_name.foreground(:green)} RT -> #{t.target_object.text}" }
chirp.on_direct_message {|t, u| puts "DM : #{t.text} (from #{t.sender.name.foreground(:red)} (#{('@' + t.sender.screen_name).foreground(:green)}))" }

chirp.connect(Chirpstream::Connect::User.oauth(access_token1, access_secret1), Chirpstream::Connect::User.oauth(access_token2, access_secret2))