Importing Comments From flickr.com Into Pixelpost

Disclaimer

These instructions/steps worked for me running CentOS. 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.


Following my previous post, about importing comments from flickr.com to my home-made photoblog, buddy Kyle thought it would be useful to have a similar API which can import comments from flickr.com into a photoblog powered by Pixelpost. Although posting the same pictures on two different platforms – once in a personal photoblog and once in flickr.com – can seem painstakingly time-consuming, it does have its advantages. 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 photoblog when there are only few comments, it can become quite tedious and even more time consuming with time. To that effect, I did some Google! search to find an XML/RSS parser, modified it to meet Pixelpost-imposed requirements. The procedure/edits follow some MUST DO things for it all to work in a seamless fashion:

  1. The image names in Pixelpost database MUST BE UNIQUE. If you are wondering how to accomplish that, you may refer to one of my previous posts.
  2. Back up the MySQL database used for Pixelpost – if something goes wrong, you will have something to revert back to. Step by step instructions for doing so are here.
  3. When posting images in flickr.com, make sure the title for that post is NOTHING BUT the filename, EXCEPT the extension (jpg or gif or png or something else).

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 – flickr2pixelpost.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 a photoblog powered by Pixelpost (one may refer to the original script & its documentation).

#! /usr/bin/php


To make sure that one doesn’t miss any comments, this above script may be run via a cron-job, twice a day or so. I no longer use Pixelpost (except on a test server) and as such, cannot demonstrate it – but if someone who uses this can send me links, I will most certainly update this post with those links. As always, if you find bugs/errors, do post them as comments and I will work on them.