LoginSignup
5
4

More than 5 years have passed since last update.

Tumblr APIを使う(1)OAuth認証

Last updated at Posted at 2013-03-13
require "oauth"
require "oauth/consumer"

@consumer = OAuth::Consumer.new(
  'consumer_key',
  'consumer_secret',
  {site: "https://api.tumblr.com"}
)
@request_token = @consumer.get_request_token

puts @request_token.authorize_url

veri = gets().chomp()

@access_token = @request_token.get_access_token(:oauth_verifier => veri)
puts @access_token.token
puts @access_token.secret

@request_token.authorize_urlをブラウザで認証したあと、oauth_verifierを入力するところで詰まった。

gets().chomp()で入れたらできた。ダサい

5
4
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4