#!/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/ # The code has been further hacked and hardly abused by Michael L. Hostbaek use LWP::Simple; use RSSLite; # List the files we want to grab. @sites = ("http://www.FreeBSD.org/news/news.rdf", "http://www.freebsdzine.org/site.rdf", "http://freshports.org/news.php3", ); print 'The last time this script stole news items from the following sites, was 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"; } else { print "Could not fetch rdf from $site."; } } print "
\n"; print "
Login | Search | Bofh | Members | News
\n\n";