photoBlog

Friday, February 10, 2006

How to make a Flickr-driven site

A little while back, I decided to redo my website. I had been maintaining my website, as well as Flickr content. Although I had created my site to be mostly dynamic, I still needed to upload photos via FTP, and depending upon my location it simply wasn't feasible.

I have been using Flickr for over a year. Not only does it have a great User Interface, but it allows me to upload photos via email, or at any location around the world. By grouping and tagging my photos, I could use the Flickr API to drive the entire working of my site.

Rather than using SOAP (which I am used to and have written code in many languages for in a professional capacity), Flickr allows you to send URL requests. This means a simple request can be sent, and the XML return simply passed to an XSL file to format the output. Trapper Markelz has a great article detailing how you can do this.

Once I had done all that work, I took it one step further by using Google Blogger to drive the article updating. Rather than a URL-based request API, Google simply publishes Atom feed XML, which you can do similar transformations on. I made a new Blog, typed up this entry, and made a new XSL transform for the Atom feed.

So, as of now, I can add articles and photos without typing a single line of code again. The entire site is driven off of 12 files (XSL, CSS, ASP and an .inc file for my reused functions). It took about 20 hours of work, and it quite possibly the fastest way of developing a site - usually it's not even the coding, but the design and UI that takes the effort.