Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
require 'oauth'
require 'uri'
key = ''
secret = ''
consumer =, secret, { site: '' })
request_token = consumer.get_request_token(exclude_callback: true)
puts request_token.authorize_url
result = gets.chomp
uri = URI.parse(result)
verifier = Hash[uri.query.split('&').map { |el| el.split('=') }]['oauth_verifier']
oauth_token = request_token.get_access_token(oauth_verifier: query['oauth_verifier'])
puts oauth_token.token
puts oauth_token.secret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.