#!/opt/perl/bin/perl -w use strict; use LWP::Simple; use URI::Escape; my ($pagebase, $filebase, $match); sub getit { my $pagename = shift; $pagename or $pagename = ""; my $page = get($pagebase . $pagename) or do {print "Can't retreive $pagebase$pagename\n"; return}; my @m = ($page =~ /$match/gs); foreach my $filename (@m) { my $savename = uri_unescape($filename); print "$savename\n"; my $dir = substr($savename, 0, 1); $dir !~ /[A-Za-z]/ and $dir = "0-9"; -d $dir or mkdir $dir; getstore("$filebase$filename", "$dir/$savename") == 200 or do {print "Can't retreive $filebase$filename\n"; next}; } } $pagebase = "http://www.filelibrary.com/Contents/Multi-Platform/89/"; $filebase = "http://www.filelibrary.com:8080/cgi-bin/freedownload/Multi-Platform/h/89/"; $match = 'http:\/\/www\.filelibrary\.com:8080\/cgi-bin\/freedownload\/Multi-Platform\/h\/89\/([^>]+)'; for (my $i = 0; $i < 70; $i++) { my $tmp = ($i == 0 ? "index" : $i); getit "$tmp.html"; } $filebase = "http://www.filelibrary.com:8080/cgi-bin/freedownload/Multi-Platform/l/90/"; $match = 'http:\/\/www\.filelibrary\.com:8080\/cgi-bin\/freedownload\/Multi-Platform\/l\/90\/([^>]+)'; for (my $i = 70; $i < 107; $i++) { getit "$i.html"; } $filebase = "http://www.filelibrary.com:8080/cgi-bin/freedownload/Multi-Platform/l/91/"; $match = 'http:\/\/www\.filelibrary\.com:8080\/cgi-bin\/freedownload\/Multi-Platform\/l\/91\/([^>]+)'; for (my $i = 107; $i < 166; $i++) { getit "$i.html"; } .