Importing Comments From flickr.com

Disclaimer

These instructions/steps worked for me in CentOS 4.0. It may very well work for you on Red Hat-like or other distributions. Please note that if you decide to use these instructions on your machine, you are doing so entirely at your very own discretion and that neither this site, sgowtham.com, nor its author is responsible for any/all damage – intellectual or otherwise.


As much as I would like to see my photographs being commented in my personally satisfying photoblog, I have recently come to realize (thanks to suggestions from several friends – Nagesh & Kyle) that it’s not a bad idea to post the same pictures on flickr.com. For one, the latter is a multi-user platform with users ranging from novice/beginners to advanced professionals. As such, there is a better chance for attracting useful comments. As easy as it might seem to manually enter comments from flickr.com to my photoblog when there are only few comments, it can become quite tedious and time consuming (at least I expect it to be) with time. To that effect, I did some Google! search to find an XML/RSS parser, modified it to meet my requirements. The procedure/edits follow:

XML/RSS Parser with PHP

flickr.com generates an RSS feed for comments that others (or I) make on my photos. This RSS feed contains all the required information – name, date-time, comment, title of the image, etc. The way I designed my photoblog, the image_name is the unique identifier and when I upload the images to flickr.com, I keep the image name as part of the title. The following script – flickr2showcase.php, not originally written by me but parts of it heavily modified, does exactly what I want – extract the information from RSS feed and arrange it in a manner that it can be incorporated into my photoblog (one may refer to the original script & its documentation).

#! /usr/bin/php


To make sure that I don’t miss any comments, I run this above script via a cron-job, twice a day. To see this in action, one may compare the same image entries in my photoblog as well as on flickr: Photoblog Entry | Flickr.com Entry

Things seem to be working without any problem so far but that doesn’t necessarily mean the code/work is without errors and/or bugs. As they show up, I will try to post work-around for them.