Class: Caboodle::FlickrAPI
- Inherits:
-
Weary::Base
- Object
- Weary::Base
- Caboodle::FlickrAPI
- Defined in:
- lib/caboodle/kits/flickr/flickr.rb
Class Method Summary collapse
- .flickr_user_id ⇒ Object
- .photoset_info(id) ⇒ Object
- .photoset_photos(id) ⇒ Object
- .photosets ⇒ Object
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ FlickrAPI
constructor
A new instance of FlickrAPI.
Constructor Details
Class Method Details
.flickr_user_id ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/caboodle/kits/flickr/flickr.rb', line 8 def self.flickr_user_id return Site.flickr_user_id unless Site.flickr_user_id.blank? unless Site.flickr_username.blank? url = "http://query.yahooapis.com/v1/public/yql?q=use%20%22http%3A%2F%2Fisithackday.com%2Fapi%2Fflickr.whois.xml%22%20as%20flickr.whois%3Bselect%20*%20from%20flickr.whois%20where%20owner%3D%22#{Site.flickr_username}%22&format=xml" doc = ::Nokogiri::XML.parse(open(url).read) val = doc.css("owner").first.attributes["nsid"].value Site.flickr_user_id = val Caboodle::Kit.dump_config end Site.flickr_user_id end |
.photoset_info(id) ⇒ Object
36 37 38 |
# File 'lib/caboodle/kits/flickr/flickr.rb', line 36 def self.photoset_info(id) Caboodle.mash(new.photoset({:photoset_id=>id,:method=>"flickr.photosets.getInfo"})).rsp.photoset end |