Tuesday, May 4, 2010

Using the Blogger RSS across domains

Problem
I run a biking blog (http://touring.praveenselvam.com) and also have a personal website (http://www.praveenselvam.com) setup, which has a single page with external links to my other sub domains. I wanted to use the RSS feed from my biking blog to add some jazz to my personal website's home page. Since these are from different sub domains, the browser wouldn't allow me to make XHR requests to my target. I wanted a solution that would be as simple as possible, not having to reinvent the wheel.

Solution
I looked through some interesting hacks on the client side, but nothing looked like a fail safe option to me. I decided to craft a request to my own domain at http://www.praveenselvam.com, that would in turn read the RSS from the sub domain at http://touring.praveenselvam.com and give me a stripped version of the information I needed.

I found a rss2html converter, which is a PHP script. I primarily went looking for a PHP script simply because my hosting was of that nature. The package comes with a converter script and a template. The template is a HTML file with simple markings on where the title, description, etc. from the RSS feed needs to come. It was quite easy to edit it, and I directly placed it on the server.


Actual feed: http://touring.praveenselvam.com/feeds/posts/default
Template:

Output:

Thrills of touring

02/21/2010 02:36 AMWelcome aboard!
04/16/2010 01:23 PMThe "been there, done that!" Map
11/02/2009 12:05 PMThe Big Rides
10/25/2009 01:41 AMWeekend Madness

Other interesting findings:
In the process of searching for alternates, I found a couple of interesting links that are good alternates on the client side itself.

1 comments:

  1. To do the same, you could have used Yahoo! Pipes (http://pipes.yahoo.com/) & the resulting feed could be shortened using Google's Feedburner.

    ReplyDelete