]> ruin.nu Git - ndwebbie.git/blobdiff - scripts/parsegalaxies.pl
LWP::Simple fix for cloudfare
[ndwebbie.git] / scripts / parsegalaxies.pl
index 0ba0f0cb160df372c08ed88ad182cc6ecb412e15..ac7e4ba6c5aebd642511f183e1bf75d75da8c04f 100755 (executable)
@@ -22,11 +22,10 @@ q{
 
 use strict;
 use warnings;
+use local::lib;
 use DBI;
 use DBD::Pg qw(:pg_types);
 
-use LWP::Simple;
-
 use FindBin;
 use lib "$FindBin::Bin/../lib";
 
@@ -77,6 +76,7 @@ my $insert = $dbh->prepare(q{INSERT INTO galaxies(tick, x, y,
        sizerank_gain_day, scorerank_gain_day, valuerank_gain_day, xprank_gain_day,
        planets,planets_gain,planets_gain_day
        ) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)});
+$dbh->do(q{DELETE FROM galaxies WHERE tick = $1},undef,$tick);
 my $countplanets = $dbh->prepare(q{SELECT count(*) from planet_stats where x = $1 and y = $2 and tick = $3});
 for my $galaxy (@galaxies) {