Proof of Concept: Static Yet Dynamic

May 26th, 2006

I created a page called Remote Feeds which uses a local proxy script on the server to allow AJAX requests to pull RSS 2.0 feeds from remote sources. I have it listing Slashdot and MSDN Blogs . They are not as speedy as I would like but it does show how it would work. The third feed is just a static RSS feed sitting on the server. It comes up quickly.

This page is now essentially a feed dashboard which can update itself by simply calling the run() method on the writer. The button at the bottom calls that method to refresh the feeds.

Feel free to take this page and Javascript and create your own feed page. Below is the Perl script I am using as the proxy to pull the remote feeds.

#!/usr/local/bin/perl

use strict;
use CGI;
require LWP::UserAgent;

my $query = CGI->new;

my $url = $query->param('url');
my $ua = LWP::UserAgent->new;
my $response = $ua->get($url);

if ($response->is_success) {
my $contentType = $response->header('content-type');
print $query->header(-type=>$contentType);
print $response->content;
}
else {
die $response->status_line;
}

Comments are closed.