X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=scripts%2Ffetchdumps.pl;h=4a7ae1b6b774dd5b6226614b812a63dc0cad5bbb;hb=HEAD;hp=0d71aeaf6159504f61ff91afcab182fab205e0bb;hpb=d1d9b988b4b9921e707b36d81ed2dfddb77188d8;p=ndwebbie.git diff --git a/scripts/fetchdumps.pl b/scripts/fetchdumps.pl index 0d71aea..4a7ae1b 100755 --- a/scripts/fetchdumps.pl +++ b/scripts/fetchdumps.pl @@ -22,10 +22,12 @@ q{ use strict; use warnings; +use local::lib; use DBI; use DBD::Pg qw(:pg_types); -use LWP::Simple; +use LWP::Simple qw/head get $ua/; +$ua->agent("Stupid user agent check is stupid"); use FindBin; use lib "$FindBin::Bin/../lib"; @@ -34,8 +36,6 @@ use ND::DB; our $dbh = ND::DB::DB(); -$dbh->do("SET CLIENT_ENCODING TO 'LATIN1';"); - my $insert = $dbh->prepare("INSERT INTO dumps(tick,type,modified,dump) VALUES(?,?,?,?)"); my $select = $dbh->prepare("SELECT 1 FROM dumps WHERE type = ? AND modified = ?"); my $updated = 0; @@ -53,12 +53,10 @@ for my $type ("planet","alliance","galaxy"){ } if ($updated){ - `perl $FindBin::Bin/parsealliances.pl $updated`; - `perl $FindBin::Bin/parseplanets.pl $updated`; - `perl $FindBin::Bin/parsegalaxies.pl $updated`; - `perl $FindBin::Bin/ndrank.pl`; + system("$FindBin::Bin/parsetick.sh", $updated); + system("$FindBin::Bin/ndrank.pl"); $dbh->do(q{UPDATE misc SET value = ? WHERE id = 'TICK'}, undef, $updated); - system 'killall','-USR1', 'irssi'; + system 'killall','-USR1', 'ndbot.pl'; local $dbh->{Warn} = 0; }