public
Description: Yet another Twitter API wrapper library in Ruby
Homepage: http://github.com/webco/tuiter
Clone URL: git://github.com/webco/tuiter.git
tuiter /
name age message
file .autotest Mon Apr 06 04:27:05 -0700 2009 Autotest configuration file [tinogomes]
file .gitignore Tue Mar 17 13:58:42 -0700 2009 Rakefile and gemspec updated, it should work fi... [Luiz Rocha]
file AUTHORS Sat May 09 15:06:59 -0700 2009 doing that thing I always forget, changelog! [lsdr]
file CHANGELOG Sat May 09 15:06:59 -0700 2009 doing that thing I always forget, changelog! [lsdr]
file LICENSE Sat Mar 14 13:54:24 -0700 2009 Adding authors, license and changelog [mlemos]
file README.rdoc Sun May 03 13:49:59 -0700 2009 updating documentation for OAuth support [Luis Cipriani]
file Rakefile Sun Apr 05 02:53:36 -0700 2009 Added RCOV rake task [tinogomes]
directory examples/ Sun May 03 13:49:59 -0700 2009 updating documentation for OAuth support [Luis Cipriani]
directory lib/ Mon Aug 17 06:57:04 -0700 2009 merging with API coverage branch [lsdr]
directory tasks/ Mon Mar 23 16:10:09 -0700 2009 Added rake tasks to execute rcov [Celestino Gomes]
directory test/ Fri May 01 18:00:49 -0700 2009 removing www from the twitter api base url [Luis Cipriani]
file tuiter.gemspec Sat May 09 15:06:59 -0700 2009 doing that thing I always forget, changelog! [lsdr]
README.rdoc

Tuiter

Tuiter was design and developed by Manoel Lemos to provide access to the Twitter API. It was developed for the experimental project called Tuitersfera Brasil, an application to monitor the Twitter usage in Brazil.

Both Tuiter and Tuitersfera were adopted, further developed and maintained by Webco Internet.

Instalation

Tuiter is avaliable as a gem on Rubyforge, so you can easily install using rubygems:

    gem install tuiter

Although it is recommended to use the gem published on Rubyforge, tuiter is also avaliable at Github. This might be useful if you want to experiment with forks or live on the bleeding edge.

To install the Github version, simply run on a console:

    gem install webco-tuiter --source=http://gems.github.com

If you already have Github gem repository on you gem source, you can leave the source part out.

Basic Usage

    require 'tuiter'
    client = Tuiter::Client.new(:username => '<twitter_login>', :password => '<twitter_pwd>')

    client.update('Hey Ho, Twitters!')

There are (or at least we want to add :-) another examples in the examples/ folder.

Using OAuth

        require 'tuiter'
        client = Tuiter::Client.new(:authentication => :oauth, :consumer_key => 'YOUR_KEY', :consumer_secret => 'YOUR_SECRET')

        # request token from Twitter
        rtoken = client.request_token
        # waits for token
        # stores token and secret
        token, secret = rtoken.token, rtoken.secret   # you could store this on session, db, etc

        # redirect to authorize url
        rtoken.authorize_url
        # user authenticate in twitter domains

        # the code below goes in the callback accessed by Twitter
        access_token = client.authorize(token,secret)
        # checks if everything's ok
        if client.authorized?
          # have fun
          15.times do
            client.update('All work and no play makes Jack a dull boy')
          end
        end

If you already have the token and secret of the user (from database, for example), you just have to do the following to authenticate them:

        client = Tuiter::Client.new(:authentication => :oauth, :consumer_key => 'YOUR_KEY', :consumer_secret => 'YOUR_SECRET', :token => token, :secret => secret)
        if client.authorized?
          # have fun
          15.times do
            client.update('All work and no play makes Jack a dull boy')
          end
        end

Register your Twitter client at twitter.com/oauth_clients

Roadmap and TO-DO list

Check out the library roadmap and to-do list in the project wiki