spherebird

Twitter-OAuth on Rails

How to Use

  • app/controllers/application_controller.rb class ApplicationController < ActionController::Base protect_from_forgery include Spherebird end

  • app/controllers/auth_controller.rb class AuthController < ApplicationController def index twitter_oauth end

    def callback
    twitter_oauth_request params[:oauth_token]
    end 
    
    def logout
    twitter_session_clear
    redirect_to root_path
    end 
    

    end

  • config/twitter_oauth.yml development:

    consumer_key:    "xxxxxxxxxxxxxxxxxxxxxx"
    consumer_secret: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    logged_in_url:   "http://xxxxxx.local"
    callback_url:    "http://xxxxxx.local/auth/callback"
    proxy:           "http://proxy.xxxxx.local:80"