X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=scripts%2Fscans.pl;h=6bfdb8e8d6e1e0da4abcae09c1a34184e3cc82a3;hb=c8c6f7aeb53d8f00aebb936ee8efb96434e7f5e4;hp=4f098c005fdda4151a49dbddbfa0cb39dd308278;hpb=a0b5f22aa2061ef8e850d3ea04e2c68b0226cd8e;p=ndwebbie.git diff --git a/scripts/scans.pl b/scripts/scans.pl index 4f098c0..6bfdb8e 100755 --- a/scripts/scans.pl +++ b/scripts/scans.pl @@ -55,15 +55,17 @@ while (my $group = $scangroups->fetchrow_hashref){ $dbh->begin_work; my $file = get("http://game.planetarion.com/showscan.pl?scan_grp=$group->{scan_id}"); - my $points = 0; - while ($file =~ m/showscan.pl\?scan_id=(\w+)/g){ - unless ($dbh->selectrow_array($oldscan,undef,$1)){ - $addScan->execute($1,$group->{tick},$group->{uid}); - ++$points; + if ($file){ + my $points = 0; + while ($file =~ m/showscan.pl\?scan_id=(\w+)/g){ + unless ($dbh->selectrow_array($oldscan,undef,$1)){ + $addScan->execute($1,$group->{tick},$group->{uid}); + ++$points; + } } + $addpoints->execute($points,$group->{uid}); + $parsedscan->execute($group->{tick},'GROUP',undef,$group->{id}); } - $addpoints->execute($points,$group->{uid}); - $parsedscan->execute($group->{tick},'GROUP',undef,$group->{id}); $dbh->commit; }