Socket
Book a DemoInstallSign in
Socket

oauth_twitter

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oauth_twitter

0.3.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

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

  • 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

  • Include OauthTwitter in your class like:

    class YouClass include OauthTwitter … end

  • 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

  • You can start calling methods on YourClass:

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

Documentation

Still a work in process...

FAQs

Package last updated on 15 Jul 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.