secret

  • Download Gist
generate_twitter_oauth_url.rb
Ruby
1 2 3 4 5 6 7 8 9 10
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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.