This project has moved and is read-only. For the latest updates, please go here.

Random Image in FavoritesGetPublicList

Topics: Developer Forum, User Forum
May 5, 2010 at 9:11 PM
Edited May 5, 2010 at 9: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
May 6, 2010 at 9: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.

May 7, 2010 at 7: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.
May 10, 2010 at 10: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.