An interesting, albeit somewhat wierd, use of an RSS feed

Posted : July 11, 2004 at 8:46 pm [America/Los_Angeles]

[via Listing installed Perl modules in RSS]

Objective

To generate an RSS feed displaying all Perl modules installed on your system

Pre-requisites

Code

#!/usr/bin/perl -w

# Installed Perl Modules to RSS
# Ben Hammersley, July 2004

use strict;
use CGI qw(:standard);
use XML::RSS;
use ExtUtils::Installed;

my $installed = ExtUtils::Installed->new();
my $machine_name = `uname -n`;

my $rss = new XML::RSS(version => '2.0');
$rss -> channel(title => "Perl Modules on $machine_name");
$rss -> channel(link => "http://www.benhammersley.com/tools/");

foreach my $module ($installed->modules()) {
my $version = $installed->version($module) || "???";

$rss -> add_item ( title => "$module $version",
description => "$module $version",
link => "http://search.cpan.org/search%3fmodule=$module",
);
}

print header('application/rss+xml');
print $rss->as_string;

Deploy this code as a CGI on your web server in a folder which has ExecCGI privileges and point your favorite RSS feeds aggregator to this CGI. That’s it! As a demo, try adding this feed to your Aggregator.

Interesting stuff, although I am not sure how useful this particular feed really is. However, it sure demonstrates how an RSS feed can be used for something very different from simply displaying blog entries.

Check out Ben Hammersley’s blog for more interesting and wierd uses of RSS feeds

- Anand

Viewed: 1092 times