public
Description: A simple Twitter API wrapper that gets out of your way.
Homepage:
Clone URL: git://github.com/mbleigh/twitterdispatch.git
name age message
file .document Mon Apr 06 06:16:43 -0700 2009 Initial commit to twitterdispatch. [mbleigh]
file .gitignore Mon Apr 06 06:16:43 -0700 2009 Initial commit to twitterdispatch. [mbleigh]
file LICENSE Mon Apr 06 06:16:43 -0700 2009 Initial commit to twitterdispatch. [mbleigh]
file README.rdoc Tue Apr 07 17:20:53 -0700 2009 Initial import, should be basically up and runn... [mbleigh]
file Rakefile Tue Apr 07 17:25:32 -0700 2009 Updating gemspec. [mbleigh]
file VERSION.yml Tue Apr 07 17:27:22 -0700 2009 Version bump to 0.0.2 [mbleigh]
directory features/ Mon Apr 06 06:16:43 -0700 2009 Initial commit to twitterdispatch. [mbleigh]
directory lib/ Thu Apr 09 12:57:17 -0700 2009 Allow for OAuth without access key and secret. [mbleigh]
directory spec/ Thu Apr 09 12:57:17 -0700 2009 Allow for OAuth without access key and secret. [mbleigh]
file twitterdispatch.gemspec Tue Apr 07 17:27:22 -0700 2009 Regenerated gemspec for version 0.0.2 [mbleigh]
README.rdoc

TwitterDispatch

TwitterDispatch is an unassuming API wrapper for Twitter based on the dispatcher from TwitterAuth. Rather than create a complex object mapping system around the simple REST API Twitter provides, TwitterDispatch simply gives you the tools to make calls directly to the API URLs and parse the results (or not).

TwitterDispatch supports both OAuth and HTTP Basic authentication strategies.

Usage

To use TwitterDispatch you will need different things depending on the strategy you are using:

  • OAuth - You will need to have already registered your application with Twitter (have a consumer key and secret) as well as performed the entire OAuth authentication process (have an access key and secret). If you don’t know much about OAuth and are building a Rails application, I would suggest using TwitterAuth instead.
  • HTTP Basic - You will need to have the screen name and password for the authenticating user.

Usage of TwitterDispatch is straightforward. Here are some basic examples to get you going.

    # OAuth Example
    dispatcher = TwitterDispatch.new(:oauth, 'myconsumerkey', 'myconsumersecret', 'myaccesskey', 'myaccesssecret')
    dispatcher.get('/account/verify_credentials') # => {'screen_name' => ...}
    dispatcher.post('/statuses/update', :status => 'Update my status.') # => {'text' => 'Update my status.' ... }

    # HTTP Basic Example
    dispatcher = TwitterDispatch.new(:basic, 'screenname', 'password')
    dispatcher.get('/statuses/friends_timeline') # => [{'text' => ...}]

    # No Auth Example
    dispatcher = TwitterDispatch.new
    dispatcher.get('/statuses/public_timeline') # => [{'text' => ...}]

    # Search Example
    dispatcher = TwitterDispatch.new
    dispatcher.search('query text') # => [{'text' => ...}]

TwitterDispatch is not meant to be complex or assuming, it literally just does the bare minimum to provide you with a simple and direct access to the Twitter API in Ruby.

Copyright

Copyright © 2009 Michael Bleigh and Intridea, Inc. See LICENSE for details.