#!/usr/bin/env ruby require 'rubygems' require_gem 'flickr' ProgramName = File.basename($0) ProgramVers = "0.2" ProgramAuth = "Patrick Mueller (pmuellr@yahoo.com)" #-------------------------------------------------------------------- # get a URL to the license #-------------------------------------------------------------------- def getLicenseURL(license) # # # # # # # licenses = Hash.new() licenses["4"] = "http://creativecommons.org/licenses/by/2.0/" licenses["6"] = "http://creativecommons.org/licenses/by-nd/2.0/" licenses["5"] = "http://creativecommons.org/licenses/by-sa/2.0/" license = licenses[license] if (license.nil?) print "Photo is licensed as NonCommercial" exit end return license end #-------------------------------------------------------------------- # fix the photo url, given the owner url #-------------------------------------------------------------------- def getPhotoURL(photoID, ownerURL) # photo.url: http://flickr.com/photos/bpc/22716359 # owner.url: http://www.flickr.com/people/bigpinkcookie/ ownerPath = ownerURL.split('/').last return "http://flickr.com/photos/#{ownerPath}/#{photoID}" end #-------------------------------------------------------------------- # #-------------------------------------------------------------------- def help() print < '#{photo.title}' by #{owner.name}

Photo '#{photo.title}' with a nice CC license, by #{owner.name}. Found using the Flickr's Create Commons Search.

HTML