#!/usr/bin/perl -w use strict; use XML::RSS; use LWP::Simple; my $content; # 'http://stage.dublincore.org/news.rss', my @remote = ( 'http://www.ilrt.bristol.ac.uk/discovery/rdf/resources/rss.rdf', 'http://www.ilrt.bristol.ac.uk/discovery/rdf-dev/roads/cgi-bin/desire/ig2rss?list=www-rdf-interest', 'http://www.ilrt.bristol.ac.uk/discovery/rdf-dev/roads/cgi-bin/desire/ig2rss?list=www-rdf-logic', 'http://xmlhack.com/rss10.php?cat=28', 'http://rdfig.xmlhack.com/index.rss', 'http://www.blogspace.com/rss/rss10', 'http://www.slashdot.com/slashdot.rdf', 'http://www.w3.org/2000/08/w3c-synd/home.rss', 'http://agents.umbc.edu/awchannel.rdf' ); # www annotation list has unpredictable URLs # # 'http://www.ilrt.bristol.ac.uk/discovery/rdf-dev/roads/cgi-bin/desire/ig2rss?list=www-annotation',, # bookmark feed: xml wellformedness errors # http://www.ilrt.bristol.ac.uk/discovery/demos/RSSWeb/newitems-daniel.brickley@bristol.ac.uk/', # TODO: use eval () to recover from XML::RSS errors print ilrt_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); $rss->parse($content); print "\n"; print_html($rss , $full); print "\n"; return ''; } print < HTML print ilrt_footer(); sub ilrt_header { my $verbosity = shift; return < ILRT RDF and Metadata channel listing
RDF hacking ILRT Home

RDF At A Glance...

Newsfeeds for Semantic Web developers... [disclaimer!]

W3C RDF: RDF home page, Interest Group, Model+Syntax spec, Schema spec, Semantic Web development
More RDF info: Dave Beckett's Resource Guide, XML.com: What is RDF?, RDF then and now
Nearby at ILRT: Redland, Rudolf RDFQuery, XJG, RDFWeb, RDFViz

HTML } sub ilrt_footer { return <
danbri\@rdfweb.org, ILRT Bristol.

Disclaimer

Note: this RSS channel viewer should be considered experimental. The mail-archive based channels need work. The XHTML needs attention: layout, style and validity... Send channel suggestions to me for now; eventually it'll read these from the Web instead. --dan

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'}}) { next unless defined($item->{'title'}) && defined($item->{'link'}); print "

  • {'link'}\">$item->{'title'}
    \n"; if ($full && $item->{'description'} ) { print ""; print $item->{'description'}; print "

    "; } 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 }