Skip to content

Instantly share code, notes, and snippets.

@alexandrebini
Created July 8, 2011 22:56
Show Gist options
  • Save alexandrebini/1073029 to your computer and use it in GitHub Desktop.
Save alexandrebini/1073029 to your computer and use it in GitHub Desktop.
get twitter kkey
def index
client = TwitterOAuth::Client.new( :consumer_key => 'key', :consumer_secret => 'key')
if session['token'].blank?
session['token'] = client.request_token(:oauth_callback => 'http://127.0.0.1:8000')
end
request_token = session['token']
if params['oauth_token'].blank?
redirect_to request_token.authorize_url
else
access_token = client.authorize(
request_token.token,
request_token.secret,
:oauth_verifier => params['oauth_verifier']
)
p '-------------'
p access_token
render :text => client.authorized?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment