Tweeb
Tweeb is a really simple, bare bones Twitter library that I created because I’m a glutton for punishment and enjoy reinventing the wheel. In all seriousness, I’m creating it because I want to understand the Twitter API and the best way to understand something is to get your hands dirty. I don’t expect anyone but me to actually use it, since John Nunemaker’s Twitter gem is most excellent.
I’m using his HTTParty gem (at least at first) for the REST API, but I might get frisky and use Yajl-Ruby to provide Stream API functionality.
Documentation
Head on over to http://rdoc.info/projects/mikedamage/tweeb to peruse the project’s RDoc at your leisure. The basics to get you up and Tweebing in no time are below:
Installing
Once I get to a stable point in development, I’ll release this project as a gem. Then all you’ll have to do is
$ sudo gem sources -a http://gems.github.com
$ sudo gem install mikedamage-tweeb
Usage
Tweeb::Client
require "rubygems"
require "tweeb"
tweeb = Tweeb::Client.new('username', 'password')
public_timeline = tweeb.public_timeline # can also be: tweeb.timeline(:public)
public_timeline.each do |tweet|
puts tweet[:text]
end
Tweeb::Stream
require "rubygems"
require "tweeb"
tweeb = Tweeb::Stream.new('username', 'password')
# Uses Twitter's "spritzer" stream
tweeb.spritzer do |tweet|
puts tweet[:text]
end
Copyright
Copyright © 2009 Mike Green. See LICENSE for details.