#!/usr/bin/perl -w # Copyright Jim Mock # # Redistribution and use in source and binary forms, with or without # modification, are permitted, providing the copyright notice and # disclaimer are included. # # THIS SOFTWARE IS PROVIDED ``AS IS'', AND ANY EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO THE LOSS OF USE, DATA, PROFITS, # OR BUSINESS INTERRUPTION) HOWEVER CAUSED FROM THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Basically, if it breaks your system or trashes your site, I'm not # responsible. That's a risk you take using this script. If you don't # like it, don't use it. # # # /usr/ports/www/p5-libwww gives you LWP::Simple. # http://freshmeat.net has http://freshmeat.net/projects/xmlrsslite/ use LWP::Simple; use RSSLite; # List the files we want to grab. @sites = ("http://www.FreeBSD.org/news/news.rdf", "http://www.freshports.org/backend/rss0.91.php", "http://slashdot.org/bsd.rdf", "http://www.bsdtoday.com/backend/bt.rdf", "http://osonline.org/syndicate.phtml?xml=yes§ion=bsd", "http://www.rootprompt.org/rss/", "http://www.maximumbsd.com/backend/mb.rdf", "http://BSDatwork.com/backend.php"); print 'Last headline update started at ' . `date "+%Y-%m-%d %H:%M:%S %Z"` . '

'; foreach $site (@sites) { my $content = get($site); if ($content) { my %result = (); parseXML(\%result, \$content); # Output as HTML print "
$result{'title'}
\n\n"; print "\n\n"; } else { print "Could not fetch rdf from $site."; } }