Over on the JaneandRichard home page, we used to show a random image from our image archive. However, to add an image to the archive we needed to register it, and this we failed to do very often. As time went on I was putting photos less often on the JaneandRichard images page, and more often on flickr. So, I updated the front page to use a flickr badge based on my flickr feed. This wasn't ideal, as it didn't combine our output.


This morning I decided to do a bit of playing, and so produced a yahoo pipe which takes Richard's flickr RSS feed, and my one as an input and returns the most recent image. I then wrote some PHP (well took the Brighton Bloggers aggregated feed PHP actually which in turn was based on the RSS reader produced by Richard Kendall) and wrote out the RSS description within some javascript. This allows me to replace the flickr badge on the home page with an image based on the combined feed.


In order to make this more useful, I used a parameter feed to allow other images to be produced by the script. So, the code
<script type="text/javascript" src="http://jane.dallaway.com/services/getImageFromFlickrRss.php?feed=http://api.flickr.com/services/feeds/photos_friends.gne%3fuser_id=11369209@N00%26friends=0%26display_all=1%26lang=en-us%26format=rss_200"></script>
returns the most recent image added by any of my contacts. The feed parameter needs to have the flickr RSS URL encoded otherwise the script will truncate the output and nothing will be produced.

So here is the output from that script - the latest photo from my contacts:

There is some cacheing going on at the yahoo pipes end, and so the RSS feed from the pipe doesn't reflect the changes in real time, or as quickly as if you run the pipe manually.