Skip to content

Instantly share code, notes, and snippets.

@MuoTK
Last active December 20, 2015 01:19
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 MuoTK/6048270 to your computer and use it in GitHub Desktop.
Save MuoTK/6048270 to your computer and use it in GitHub Desktop.
とーくんとーくん!
#encoding: utf-8
require 'oauth'
require 'net/https'
require 'openssl'
# miteitazo
CONSUMER_KEY = "***"
CONSUMER_SECRET = "***"
oauth = OAuth::Consumer.new(
CONSUMER_KEY,
CONSUMER_SECRET,
site: "https://api.twitter.com"
)
request_token = oauth.get_request_token
puts "Access this URL: #{request_token.authorize_url}"
print "PIN: "
pin = gets.to_i
access_token = request_token.get_access_token(
oauth_verifier: pin
)
puts access_token.token, access_token.secret
puts 'ok'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment