it;s pretty easy with the perl LWP library...
just gotta get the page, parse it and publish it yourself.
here is a quick little hack to get you started. It can be made to be quite elegant....
Code:
#!/usr/bin/perl
## Program Name: fetch.pl
use LWP::Simple;
print "Content-type: text/html\n\n";
&page_header;
########################################
# Get Content
# accepts:
# url to page
# img replacement string for relative addresses, change "pix/img.gif" to "http://www.site.com/pix/img.gif"
# url repalcement string both of these don't happen if set to O
# string to start grabbing at
# string to end with
########################################
&getcontent("http://site.com/page.html",
"0",
"0",
"<start string>",
"<end string>");
}
&page_footer;
## End of program.
sub getcontent{
local ($url,$base_url_img, $base_url_href, $start_string, $end_string) = @_;
unless (defined ($page = get($url))) {
die "There was an error getting URL: $url\n";
}
@page = split(/\n/,$page);
$start=0;
foreach $line (@page){
if ($base_url_img ne "0"){
$line =~ s/src=\"/src=\"http:\/\/$base_url_img/gi;
}
if ($base_url_href ne "0"){
$line =~ s/href=\"/href=\"http:\/\/$base_url_href/gi;
}
if($line =~ /$start_string/){
$start = 1;
}
if($line =~ /$end_string/){
$start = 0;
}
if ($start == 1){
print "$line\n";
}
}
}
sub page_header{
print qq~
<HTML>
<HEAD>
<TITLE>Stolen Stuff</TITLE>
</HEAD>
<BODY>
~;
}
sub page_footer{
print qq~;
</BODY>
</HTML>
~;
}
[This message has been edited by cdavis (edited June 10, 1999).]