lib/flickr/photos.rb in commonthread-flickr_fu-0.2.2 vs lib/flickr/photos.rb in commonthread-flickr_fu-0.3.0
- old
+ new
@@ -146,11 +146,11 @@
# * page (Optional)
# The page of results to return. If this argument is omitted, it defaults to 1.
# * media (Optional)
# The type of media to search for. 'photo', 'video', or 'both' are allowed arguments, with 'both' being the default.
#
- def get_recent(options)
+ def get_recent(options = {})
options.merge!({:extras => "license,date_upload,date_taken,owner_name,icon_server,original_format,last_update,geo,tags,machine_tags,o_dims,views,media"})
rsp = @flickr.send_request('flickr.photos.getRecent', options)
returning PhotoResponse.new(:page => rsp.photos[:page].to_i,
@@ -198,9 +198,14 @@
rsp.licenses.license.each do |license|
licenses[license[:id].to_i] = Flickr::Photos::License.new(:id => license[:id].to_i, :name => license[:name], :url => license[:url])
end
end
end
+ end
+
+ # creates and/or returns the Flickr::Photos::Geo object
+ def geo
+ @geo ||= Flickr::Photos::Geo.new(@flickr)
end
# Returns a Flickr::Photos::Photo object of the given id.
# Raises an error if photo not found
def find_by_id(photo_id)