Jason Famularo has made a nice Google module to display one or a set of Flickr pictures. The problem is that I want to display one of my own images in a random fashion. The Flickr API has a flickr.photos.search method that allows you to retrieve the photos of a specific user. The problem is that you cannot retrieve them in a random order. There are the only parameters that allow you to change the photo order:

min_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

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

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

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.

sort

Deafults to date-posted-desc. The possible values are: date-posted-asc, date-posted-desc, date-taken-asc, date-taken-desc, interestingness-desc, interestingness-asc, and relevance.


This means that I had to find a "hack" ;)

(more…)