Note that it won't fetch a file if you already have a file by that name
in the current directory. So if you interrupt it in the middle of a
transfer, delete the file it was working on before re-running. However,
if you want to grab a bunch of files and then stop it and look at those
and re-run to get some more, it will do that fine.
====cut here====
#!/usr/bin/perl
# Snarf all the CGWs from the archive on Filefront
$YEAR=1981;
$MONTH=11;
for ($ISSUE = 1; $ISSUE < 101; $ISSUE++) {
if (($ISSUE == 21) or ($ISSUE == 23)) { $MONTH += 1; }
if ($ISSUE < 25) {
# First 24 did not have an underscore between the two month numbers
if ($MONTH < 9) { $m = "0" . $MONTH . "0" . ($MONTH+1); }
if ($MONTH == 9) { $m = "0910"; }
if ($MONTH > 9) {$m = $MONTH . $MONTH+1;}
$name = $YEAR . "_" . $m . "_issue" . $ISSUE . ".pdf";
} else {
# 25 - 100 do contain an underscore, and there are several double
# months
$d = 0;
if (($ISSUE == 25) or ($ISSUE == 29) or ($ISSUE == 31) or
($ISSUE == 34) or ($ISSUE == 38) or ($ISSUE == 39) or
($ISSUE == 73)) {
$d = 1;
}
if ($d) {
if ($MONTH < 9) {
$m = "0" . $MONTH . "_0" . ($MONTH + 1);
}
if ($MONTH == 9) {
$m = "09_10";
}
if ($MONTH > 9) {
$m = $MONTH . "_" . ($MONTH + 1);
}
$MONTH++;
} else {
$m = $MONTH;
if ($MONTH < 10) {
$m = "0" .$MONTH;
}
}
}
$name = $YEAR . "_" . $m . "_issue" . $ISSUE . ".pdf";
system("wget http://static.filefront.com/cgw/$name")
unless (-e $name);
$MONTH++;
if ($ISSUE < 25) { $MONTH++; };
if ($MONTH > 12) {
$MONTH = $MONTH - 12;
$YEAR++;
}
}
# Special issues of Computer Gaming Forum (1987)
for ($MONTH = 1; $MONTH < 3 ; $MONTH++) {
system("wget http://static.filefront.com/cgw/1987_SPECIAL_CGF%20$MONTH.pdf")
unless (-e $name);
}
====cut here====
Stephane