X-Git-Url: https://ruin.nu/git/?p=ndwebbie.git;a=blobdiff_plain;f=scripts%2Fndrank.pl;h=abfd1cec973f356569e148b2d9e35fa19ae31873;hp=be8b1cc4f99f0cd084770c961984c97d1722290d;hb=36a13cae169413fc04fbf704d94a2ad797336e6e;hpb=9154d589bf4a0dc3310ee79752c71674f69c85a7 diff --git a/scripts/ndrank.pl b/scripts/ndrank.pl index be8b1cc..abfd1ce 100755 --- a/scripts/ndrank.pl +++ b/scripts/ndrank.pl @@ -25,15 +25,15 @@ use warnings; use DBI; use DBD::Pg qw(:pg_types); -use LWP::Simple; +use FindBin; +use lib "$FindBin::Bin/../lib"; -use lib qw{/var/www/ndawn/}; use ND::DB; our $dbh = ND::DB::DB(); $dbh->begin_work; -my $st = $dbh->prepare(q{SELECT uid FROM current_planet_stats p JOIN users u ON p.id = u.planet WHERE alliance_id = 1 ORDER BY score DESC}); +my $st = $dbh->prepare(q{SELECT uid FROM current_planet_stats p JOIN users u USING (pid) WHERE alliance = 'NewDawn' ORDER BY score DESC}); my $update = $dbh->prepare(q{UPDATE users SET rank = ? WHERE uid = ?}); $st->execute; my $rank = 1;