Look At All The Pretty Pictures!

05 August 2005

So I moved my webpage and was all of a sudden faced with a deluge of emails from people who I never even knew read the thing. Among those emails was a request from my amigo Chaffee requesting more pictures. Seeing as I’d always wanted to play with the Flickr API, I requested an API Key and started hacking away at some PHP. The end result is that on the left side of this page, you now get to see whatever happens to be the latest picture I’ve taken on my mobile phone.

The moment I take a picture with my cellphone, it gets emailed to the magical servers at Flickr and tagged with a title, some keywords, and a description. The next time someone loads this page, a small PHP script in the innards of this site makes a SOAP request to Flickr’s servers and retrieves an XML response. This response is then parsed out and a URI to the thumbnail image on Flickr’s servers is generated which is then inserted into this page. To improve performance a tiny bit, I avoid the overhead of the SOAP call every time this page is loaded by caching the response for five minutes and reading the cached XML if it’s available.

For those of you who are into RSS, I’ve added a Flickr feed to my pictures in the HTML headers on this site.

My goal—and this is entirely for you, Chaffee—is to take at least one picture a day, which is far more ambitious a schedule than my posting to this page. We’ll see how that works out.