require "i:/html/http-lib.pl"; # NOTE: Modified lib file
$proxyHost = 'wingate';
$proxyPort = 80;
# USE a Proxy -- new http-lib function
&HTTPProxy ($proxyHost, $porxyPort);
$port = 80;
$site = 'www.anzwers.com.au';
$queryString = "isbn=$0201634627";
$fileName = "/";
print "GET http://$site:$port$fileName?$queryString\n";
$buf = &HTTPGet ($fileName, $site, $port, $queryString);
print 'header-->' . $httpHead . '<--\n'; # show HTTP header
$databuf = removeHtml($buf);
unless ($httpErrorCode) {
print ' okay\n===>' . $databuf . '<===\n';
}
exit;
sub removeHtml { # massage input file to get data from HTML
local ($s) = @_;
local ($len, $i, $j);
$len = length($s);
$i = 0;
while (($i = index($s, '<', $i)) > -1) {
unless (($j = index($s, '>', $i + 1)) > -1) { # no matching terminator!
last; # finished!
}
$s = substr($s, 0, $i) . substr($s, $j + 1);
}
$s =~ s/\s*//;
return $s;
}