2008/06/05

le chat qui voit / improvement of FlickrRandomImage

p4050108
Olympus E300
Taipei, Taiwan
20060405

旁觀者

****

Originally, FlickrRandomImage only shows 10 images from a random page of my flickr account. I found that it's not so interesting. I want the results to be more various; in other words, I want to have 10 images individually from different pages, instead of from the same page.

In order to make this modification, at first I have to know the total amount of my photos on flickr. I can get a Person object by calling the following API:

Flickr.PeopleGetInfo(userid);

and then, with the Person object, I can access PhotosSummary object in which there's an attribute -- PhotoCount.

Now, I can create a PhotoSearchOptions object with PerPage = 1 and Page = a_random_number_genereted_between_1_and_photoAmount

Do a for loop for 10 times. That's it! Quite Simple, n'est-ce pas?

Somehow, I found the performance is quite slow. Anyways, it works now. I will find another day to fix the performance issue.

ps. With my new modification, I found this cute cat.

沒有留言:

張貼留言

中國 App 商業模式 -- 王泌

很有系統地介紹了中國近幾年比較大的幾十個 app,包含他們主要的商業模式,投資者,和特色在哪裡。對於想要了解中國 App (網路服務) 市場的人來說,會是個很好的入門書。雖然已經是兩三年前的資料了,這兩三年又有了很大的變化,但依然是個很好的起點。