X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=scripts%2Fndrank.pl;h=be8b1cc4f99f0cd084770c961984c97d1722290d;hb=fe92f95649f91029d18ec050252382332fe0fb96;hp=cc7c12767e190b8681de3b72f44cdc663703998d;hpb=c643b311c8f134a59625192b900aa28b3f12d4f1;p=ndwebbie.git diff --git a/scripts/ndrank.pl b/scripts/ndrank.pl index cc7c127..be8b1cc 100755 --- a/scripts/ndrank.pl +++ b/scripts/ndrank.pl @@ -27,15 +27,10 @@ use DBD::Pg qw(:pg_types); use LWP::Simple; -our $dbh; -for my $file ("/home/whale/db.pl") -{ - unless (my $return = do $file){ - warn "couldn't parse $file: $@" if $@; - warn "couldn't do $file: $!" unless defined $return; - warn "couldn't run $file" unless $return; - } -} +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});