perl code for parseMediachannel.pl
#!/usr/pkg/bin/perl -w
#----------------------------------------------------------------
#--- this script depends on Perl modules installed at Freeshell
#----------------------------------------------------------------
$URL = "http://www.newsdissector.org/weblog/";
use LWP::Simple;
unless (defined ($webPage = get $URL)) {
die "could not get $URL\n";
}
#--- cut the header information and all the left/top nav
$webPage =~ s/<head>.*?(<font color="#CC0000")/$1/s;
#--- cut the right nav boxes and ads
$webPage =~ s/<table.*?bgcolor="#FFCC00".*(<font.*?color="#00000 0">)/$1/s;
#--- cut the footer information
$webPage =~ s/(Posted by.*?<\/font>).*(<\/body>)/$1\n$2/s;
#--- return the result to a browser CGI query
print "Content-type:text/html\n\n";
print $webPage;
|