Oh yeah, it does pay to give stuff away! Or at least to put half baked ideas “out there”. After just posting late last night about my crude 5 card flickr story demo I lamented the problems in code I had in easily getting random flickr photos from a given tag, John Krutsch emailed and offered some code to do what I needed more elegantly.

I was going through gyrations to pull photos from an RSS feed, which meant I could only grab newer pix; John’s code scavenges all the photos by cleverly parsing the results of the flickr search results. I plunked in all his code and got all of the duct tape in place and was stunned that I did not have my usual round of 20 PHP typos in a row.

It did work as advertised, though I notice every time it had to do the search, there was a 10-15 second delay. This is because John’s code is storing all the search results in an array and then doing the random selection from that pool. I was able to speed up the experience by adding my own code to cache the array of search results into a local server text file, and then hitting that cache file for the data if it is less than an hour old.

So the new and improved (only under the hood, tomorrow the site needs to go into the body shop for shaping and painting) 5 Card Flickr Story site is now hitting any photo tagged in flickr as 5cardflickr… so start back tagging now! Please! I want lots of photos!

And a big thanks to John Krutsch for paying it forward!

And another big thanks to someone named “Sparkle” as the first person besides me to do a story- check out “and then the dog shows up”

Bonus points for stories about dogs…

The post "Give and the Nets Giveth Back" was originally scraped from the bottom of the pickel barrel at CogDogBlog (http://cogdogblog.com/2008/09/give-and-the-web-giveth-back/) on September 9, 2008.

4 Comments

Leave a Comment

All fields are required. Your email address will not be published.