Howdy,
The other day I had an inkling to "tune" the types of photos that the screensaver uses. So found the /usr/pluto/bin/flickr.pl script and took a look see. There appears to be the capability to specify search tags, but they don't work (actually specifying a tag stops all fetching from flickr). I then dived into the flickr API to understand enough to maybe troubleshoot flickr.pl. I ended up writing a script that can handle fetching photos by user id/name, photoset, group, photo search (tags, text,...), and of course interestingness (what works in flickr.pl). I then started thinking of replacing flickr.pl, so added LinuxMCE file structure and reaping. I'm at the point of adding the database hooks and daemonizing the script and decided now is probably a good time to bounce this off of the community.
BTW, my current hypothesis on what is wrong with flickr.pl is that the flickr API has changed since the Flickr::API version 0.08 module was released in March 2006. There is a newer version, 0.09 available that was released in Feb 2008 that might resolve the tag search problem.
To give you a better feel for what my script can do, here's it's current config file:
# This is the configuration file for /home/royw/views/flickrfetchr/flickrfetchr and is where
# you specify what images you want fetched from flickr for the LinuxMCE screensaver
#
# To take full advantage of these options, you should have an account on http://www.flickr.com
#
# For those who are familiar with ruby, the format for this file should be obvious :)
# But for the vast majority, here goes:
#
# Comments start with an '#' and extend to the end of the line
#
# We are initializing the config Hash so each line starts with "config[key]". The keys
# are all symbols so start with a colon (":key").
#
# Each hash value is an Array so is enclosed in square brackets:
# config[:key] = []
#
# Empty brackets are permissible
#
# Each element in the value Array is a Hash so is inclosed with curly brackets:
# config[:key] = [{}, {}, ...]
#
# Each element in the Hash is a key/value pair which are seperated by a =>
# config[:key] = [{:key1 => value1, :key2 => value2, ...}]
#
# Again each key is a symbol and starts with a colon
#
# String values are enclosed with single quotes while integers are not. In this
# config file, all values are either integers or strings, even though I document
# the strings with more descriptive types like 'USER_ID' or 'PATH'.
# config[:key] = [{:key1 => '/home/flickr', :key2 => 20, ...}]
#
# Each section includes an example at the end which starts with ## which show
# proper syntax for that section.
#****** Fetch photo definitions
#***********************************************************************
# To fetch photos from a user account using either the flickr user ID or the user name:
# config[:USERS] = [{
# :nsid => USER_ID OR :username => FLICKR_USER_NAME, # required
# :destination => :linuxmce_flickr OR PATH, # optional, defaults to :linuxmce_flickr
# :limit => INTEGER # optional, defaults to @config[:limit]
# :extras => STRING # don't use
# :per_page => INTEGER # optional, defaults to :limit
# :page => INTEGER # optional, defaults to 1
# }]
##
## this example selects all pictures (up to @config[:limit]) from the user "royw2" flickr account:
config[:USERS] = [{:username => 'royw2'}]
#***********************************************************************
# you can also fetch photos from flickr groups again by either group ID or group name:
# config[:GROUPS] = [{
# :nsid => GROUP_ID OR :groupname => GROUP_NAME, # required
# :destination => :linuxmce_flickr OR PATH, # optional, defaults to :linuxmce_flickr
# :limit => INTEGER # optional, defaults to @config[:limit]
# :tags => STRING # optional, A tag to filter the pool with.
# # At the moment only one tag at a time is supported.
# :extras => STRING # don't use
# :per_page => INTEGER # optional, defaults to :limit
# :page => INTEGER # optional, defaults to 1
# }]
##
## this example will fetch photos from two groups: 'Deep Space Astrophotography' and 'Worlds of fancy_computer generated landscapes'.
## The group id for 'Deep Space Astrophotography' is '16194850@N00' so we will use it:
## config[:GROUPS] = [{:nsid => '16194850@N00'}, {:groupname => 'Worlds of fancy_computer generated landscapes'}]
#***********************************************************************
# config[:PHOTOSETS] = [{
# :nsid => USER_ID OR :username => FLICKR_USER_NAME, # required
# :destination => :linuxmce_flickr OR PATH, # optional, defaults to :linuxmce_flickr
# :title => STRING #
# :limit => INTEGER # optional, defaults to @config[:limit]
# :title => STRING # optional, matches one set, default is to match all sets
# :extras => STRING # don't use
# }]
##
## Say I want to keep a local copy of one of my photosets ('Our Canine Family'), but not include it in the LinuxMCE screensaver
## config[:PHOTOSETS] = [{:username => 'royw2', :title => 'Our Canine Family', :destination => '/home/royw/photos/dogs'}]
#***********************************************************************
# config[:SEARCHES] = [{
# :nsid => USER_ID OR :username => FLICKR_USER_NAME, # required
# :destination => :linuxmce_flickr OR PATH, # optional, defaults to :linuxmce_flickr
# :limit => INTEGER # optional, defaults to @config[:limit]
# :tags => STRING # optional, A comma-delimited list of tags.
# # Photos with one or more of the tags listed will be returned.
# :tag_mode => 'any' OR 'all' # optional, Either 'any' for an OR combination of tags,
# # or 'all' for an AND combination.
# # Defaults to 'any' if not specified.
# :text => STRING # optional, A free text search. Photos who's title,
# # description or tags contain the text will be returned.
# :min_upload_date => STRING # optional, Minimum upload date. Photos with an upload
# # date greater than or equal to this value
# # will be returned. The date should be in the
# # form of a unix timestamp.
# :max_upload_date => STRING # optional, Maximum upload date. Photos with an upload
# # date less than or equal to this value will be returned.
# # The date should be in the form of a unix timestamp.
# :min_taken_date => STRING # optional, Minimum taken date. Photos with an taken
# # date greater than or equal to this value will be returned.
# # The date should be in the form of a mysql datetime.
# :max_taken_date => STRING # optional, Maximum taken date. Photos with an taken
# # date less than or equal to this value will be returned.
# # The date should be in the form of a mysql datetime.
# :license => STRING # optional, The license id for photos (for possible values
# # see the flickr.photos.licenses.getInfo method).
# # Multiple licenses may be comma-separated.
# :extras => STRING # don't use
# :per_page => INTEGER # optional, defaults to :limit
# :page => INTEGER # optional, defaults to 1
# }]
##
## Now say I want to include photos of LinuxMCE systems that are on flickr and up to 20 computer case mods:
## config[:SEARCHES] = [{:text => 'LinuxMCE'},
## {:tags => 'computer,case,mods', :limit => 20}
## ]
#***********************************************************************
# config[:INTERESTING] = [{
# :nsid => USER_ID OR :username => FLICKR_USER_NAME, # optional
# :destination => :linuxmce_flickr OR PATH, # optional, defaults to :linuxmce_flickr
# :limit => INTEGER # optional, defaults to @config[:limit]
# :date => STRING # optional, a date string
# :daycount => INTEGER # optional, the number of days up to :date to look
# # for photos. defaults = 0 (i.e., just :date)
# :extras => STRING # don't use
# :per_page => INTEGER # optional, defaults to :limit
# :page => INTEGER # optional, defaults to 1
# }]
##
## Say I'm feeling nostalgic for the orginal photo selection in LinuxMCE:
## config[:INTERESTING] = [{:limit => 100, :daycount => 5}]
#****** Global Fetch Options
# The following are global options with the default values
# please note that the value syntax differs from the above sections.
#***********************************************************************
# The maximum number of files to attempt to download at a time
## config[:limit] = 3
#***********************************************************************
# Sometimes downloading from flickr is unreliable, so we can retry the
# operation this many times:
## config[:max_save_attempts] = 3
#***********************************************************************
# When FlickrFetcher downloads an image, it limits downloading to the largest possible image that is
# less than or equal to config[:image_max_size] and greater than or equal to config[:image_min_size].
# This is the maximum photo size to download. If the requested photo exceeds this size in either width or height,
# then we try to find the next smaller image. If there are no smaller images, then the image is not downloaded.
## config[:image_max_size] = {:width => 1920, :height => 1080}
# Setting either width or height to less than or equal to 0 disables the checking for a maximum size.
## config[:image_max_size] = {:width => 0, :height => -1080}
# This is the minimum photo size to download. If the requested photo is smaller than this size in either width or
# height then the photo is not downloaded.
## config[:image_min_size] = {:width => 1024, :height => 720}
# Setting either width or height to less than or equal to 0 disables the checking for a minimum size.
## config[:image_min_size] = {:width => -1920, :height => 0}
#***********************************************************************
# config[:image_scale_to_size] = {:width => 1920, :height => 1080}
#***********************************************************************
# config[:linuxmce_flickr] = {:max_files => 100}
Thank you,
Roy