Skip to content

Instantly share code, notes, and snippets.

@ahmdrefat
Created November 12, 2012 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmdrefat/56e1f5f2c77e8e92bb44 to your computer and use it in GitHub Desktop.
Save ahmdrefat/56e1f5f2c77e8e92bb44 to your computer and use it in GitHub Desktop.
def generate_twitter_oauth_url
oauth_callback = "http://#{request.host}:#{request.port}/oauth_account"
@consumer = OAuth::Consumer.new("your-consumer-key","your-consumer-secret", :site => "https://api.twitter.com")
@request_token = @consumer.get_request_token(:oauth_callback => oauth_callback)
session[:request_token] = @request_token
redirect_to @request_token.authorize_url(:oauth_callback => oauth_callback)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment