#!/usr/local/bin/perl -w #dan's perl rss aggregator from http://ilrt.org/discovery/2001/05/rss-agg #hacked to use my photo feeds feeds #use strict; use XML::RSS; use LWP::Simple; my $dir="http://www.ilrt.bristol.ac.uk/discovery/2003/03/rss/"; my $content; my @remote = ( $dir . "2003.rss", $dir . "2002.rss", $dir . "2001.rss", $dir . "2000.rss" ); # TODO: use eval () to recover from XML::RSS errors print header(); print "last update: ".`date`."
"; #sigh, can't be bothered to perlman print < HTML my @todo=@remote; print "
\n"; my $verbo = 'full'; # verbosity while (@todo) { my $lhs = shift @todo; # my $mid = shift @todo; my $rhs = shift @todo; print ""; cell($lhs , $verbo ); # cell($mid , $verbo ); cell($rhs, $verbo ); print ""; } print "
\n\n"; sub cell { my $uri=shift; my $full =shift; if (!$uri) { return; } my $rss = new XML::RSS; # eval (" my $content = get($uri) or die($!); $rss->parse($content); print "\n"; print_html($rss , $full); print "\n"; return ''; } print < HTML print footer(); sub header { my $verbosity = shift; my $sourcefiles=""; my $count=0; foreach $a (@remote){ $sourcefiles=$sourcefiles . " \n" . $a ; if($count<$#remote){ $sourcefiles=$sourcefiles . ", "; } $count++; } return < ILRT Semantic Web technical reports

ILRT Semantic Web technical reports at a glance

For more information see the Semantic Web group page

Search using keyword


HTML } sub footer { return <This viewer uses Dan Brickley's code

This is a little traversal program which goes through a directory picking out index.html and readme.html, and getting the titles to build an rss file. For usage, see Makefile, for files (perl and the rss files) see directory.


libby.miller\@bristol.ac.uk, ILRT Bristol, 2003-03-12.
HTML } ###################################### RSS 2 HTML code (from xml:rss) # SUBROUTINES sub print_html { my $rss = shift; my $full = shift; print <
$rss->{'channel'}->{'title'}

$rss->{'channel'}->{'description'}

HTML # print channel image if ($rss->{'image'}->{'link'}) { print <

$rss->{'image'}->{'title'}{'image'}->{'width'}\"" if $rss->{'image'}->{'width'}; print " height=\"$rss->{'image'}->{'height'}\"" if $rss->{'image'}->{'height'}; print ">

\n"; } # print the channel items foreach my $item (@{$rss->{'items'}}) { if ($full && $item->{'description'} ) { print "

"; print $item->{'description'}; print "
"; } next unless defined($item->{'title'}) && defined($item->{'link'}); print "{'link'}\">$item->{'title'}

\n"; print "\n"; } # if there's a textinput element if ($rss->{'textinput'}->{'title'}) { print < $rss->{'textinput'}->{'description'}

HTML } # if there's a copyright element if ($rss->{'channel'}->{'copyright'}) { print <$rss->{'channel'}->{'copyright'}

HTML return 0; } print <
HTML }