Skip to content
An EventMachine-based client for http://chirpstream.twitter.com.
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
bin
image
lib
Gemfile
Rakefile
Readme.rdoc
VERSION
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('joshbuddy', 'xxxxxxxx')
chirp.reconnect{ puts "reconnecting..." }
chirp.tweet {|t| puts "#{t.text} (from #{t.user.name.foreground(:red)} (#{('@' + t.user.screen_name).foreground(:green)}))" }
chirp.follow {|t| puts "#{t.source.screen_name.foreground(:green)} following #{t.target.screen_name.foreground(:green)}" }
chirp.favorite {|t| puts "#{t.source.screen_name.foreground(:green)} <3 -> #{t.target_object.text}" }
chirp.retweet {|t| puts "#{t.source.screen_name.foreground(:green)} RT -> #{t.target_object.text}" }
chirp.direct_message {|t| puts "DM : #{t.text} (from #{t.sender.name.foreground(:red)} (#{('@' + t.sender.screen_name).foreground(:green)}))" }
chirp.connect

Oauth Usage

chirp = Chirpstream.new
chirp.consumer_token = "XXX"
chirp.consumer_secret = "XXX"
chirp.access_token = "XXX"
chirp.access_secret = "XXX"
chirp.reconnect{ puts "reconnecting..." }
chirp.tweet {|t| puts "#{t.text} (from #{t.user.name.foreground(:red)} (#{('@' + t.user.screen_name).foreground(:green)}))" }
chirp.follow {|t| puts "#{t.source.screen_name.foreground(:green)} following #{t.target.screen_name.foreground(:green)}" }
chirp.favorite {|t| puts "#{t.source.screen_name.foreground(:green)} <3 -> #{t.target_object.text}" }
chirp.retweet {|t| puts "#{t.source.screen_name.foreground(:green)} RT -> #{t.target_object.text}" }
chirp.direct_message {|t| puts "DM : #{t.text} (from #{t.sender.name.foreground(:red)} (#{('@' + t.sender.screen_name).foreground(:green)}))" }
chirp.connect_oauth
Something went wrong with that request. Please try again.