From 9a3ef7b4fb740f3813e378bbf0bd9ba49ece0aad Mon Sep 17 00:00:00 2001 From: Stefan Cosma Date: Fri, 21 Nov 2014 07:58:00 +0000 Subject: [PATCH] New Flickr sample code --- Samples/flickr.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Samples/flickr.rb diff --git a/Samples/flickr.rb b/Samples/flickr.rb new file mode 100644 index 0000000..bdf88f1 --- /dev/null +++ b/Samples/flickr.rb @@ -0,0 +1,29 @@ +# Flickr is an image hosting and video +# hosting website, and web services suite +# +# This example uses a third-party ruby library to authenticate a user +# and output the most recent photo. +# +# Please see these for more information: +# +# https://www.flickr.com/services/developer +# https://github.com/hanklords/flickraw + +require 'flickraw' + +FlickRaw.api_key="YOUR_API_KEY" +FlickRaw.shared_secret="YOUR_APP_SECRET" + +list = flickr.photos.getRecent + +id = list[0].id +secret = list[0].secret +info = flickr.photos.getInfo :photo_id => id, :secret => secret + +puts info.title +puts info.dates.taken + +sizes = flickr.photos.getSizes :photo_id => id + +original = sizes.find {|s| s.label == 'Original' } +puts original.width \ No newline at end of file