Module: Flickrie::OAuth

Defined in:
lib/flickrie/oauth.rb

Defined Under Namespace

Modules: Token Classes: AccessToken, RequestToken

Constant Summary

URL =
'http://www.flickr.com/services/oauth'.freeze
NO_CALLBACK =
'oob'.freeze

Class Method Summary collapse

Class Method Details

.get_access_token(verifier, request_token) ⇒ Object



47
48
49
50
51
52
53
54
# File 'lib/flickrie/oauth.rb', line 47

def self.get_access_token(verifier, request_token)
  connection = new_connection(request_token)
  response = connection.get "access_token" do |req|
    req.params[:oauth_verifier] = verifier
  end

  AccessToken.new(response.body)
end

.get_request_token(options = {}) ⇒ Object



38
39
40
41
42
43
44
45
# File 'lib/flickrie/oauth.rb', line 38

def self.get_request_token(options = {})
  connection = new_connection
  response = connection.get "request_token" do |req|
    req.params[:oauth_callback] = options[:callback_url] || NO_CALLBACK
  end

  RequestToken.new(response.body)
end