Class: Flickry::Flickr

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/flickry.rb

Instance Method Summary collapse

Constructor Details

#initializeFlickr

:nodoc:



33
34
# File 'lib/flickry.rb', line 33

def initialize # :nodoc:
end

Instance Method Details

#authorize(args = {}) ⇒ Object



36
37
38
39
40
41
42
43
# File 'lib/flickry.rb', line 36

def authorize(args={})
  full_args = {:api_key => Flickry.api_key, :perms => 'read'}
  args.each {|k, v| full_args[k.to_sym] = v }
  full_args[:api_sig] = Flickry.api_sig(full_args) if Flickry.shared_secret
  url = 'http://' + Flickry::FLICKR_HOST + Flickry::AUTH_PATH + full_args.collect { |a, v| "#{a}=#{v}" }.join('&')
  puts url
  self.class.get(url)
end