0.0
No commit activity in last 3 years
No release in over 3 years
An OAuth library to interact with Twitter API v1.1, by simply calling methods on instances.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0

Runtime

>= 1.4.5
 Project Readme

OauthTwitter

An OAuth library to interact with Twitter API v1.1, by simply calling methods on instances. The methods name is designed to be similar to Twitter's API. For example:

If you want to load home timeline for certain user, just do:

response = your_instance.home_timeline
response.each {|r| process_response(r)}

The response is a nested hash that structured the same as Twitter's response JSON.

1. Installation

Add this line to your application's Gemfile:

gem 'oauth_twitter'

Then execute:

$ bundle install

Or install it yourself use:

$ gem install oauth_twitter

2. Setup and Usage

  1. Configure OauthTwitter on app initialization:

    OauthTwitter::Config.setup do |c| c.consumer_key = "#{your_twitter_consumer_key}" c.consumer_secret = "#{twitter_consumer_secret}"

    Your don't have to include following in your initializer,

    but OauthTwitter will fallback to this url

    if you don't provide them in certain functions' args

    c.oauth_callback = "#{oauth_request_token_callback_address}" end

  2. Include OauthTwitter in your class like:

    class YouClass include OauthTwitter … end

  3. Implement attr_accessor in your class, so OauthTwitter could load tokens from YourClass:

    class YourClass include OauthTwitter

    attr_accessor :oauth_token, :oauth_token_secret ... end

  4. You can start calling methods on YourClass:

    you_instance = YourClass.new you_instance.request_token("callback_url")

Documentation

Still a work in process...