Random Image in FavoritesGetPublicList

Topics: Developer Forum, User Forum
May 5, 2010 at 8:11 PM
Edited May 5, 2010 at 8:14 PM
Is there any way to get an random image(one) from FavortiesGetPublicList, other than randomly selecting one from the favorite photos array. ? I need to fetch only one random image out of favorites, so its just unnecessary to get all favorites on every request (to pick one random one). Using C# version of FlickrNet 3.0. Solid API out there. Thank you very much
Coordinator
May 6, 2010 at 8:27 AM
The only way around this is to make two calls - in the first you can
ask for page 1, and one photo per page. Flickr will then return the
total number of favourites (in the PhotoCollection.Total property).

Then you can make your second call, asking for one photo per page
again, but this time asking for a random page.

Sam
May 7, 2010 at 6:05 PM
Thanks sam, The Total could be found in Photos.TotalPages & Photos.TotalPhotos. How do we ask for random page ? I dont see any options in PhotoSearchExtras.
Coordinator
May 10, 2010 at 9:48 AM
You just need to generate a random number between 1 and TotalPages and
request that particular page - there is nothing in the Flickr API to
do that for you.

Sam