X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=scripts%2Fndrank.pl;h=e5d152c936f64208a2e78e396b5586ed0d189ff4;hb=5b6c3c7d0003d636c1c3da6d25734e4aad5736a5;hp=cc7c12767e190b8681de3b72f44cdc663703998d;hpb=c643b311c8f134a59625192b900aa28b3f12d4f1;p=ndwebbie.git diff --git a/scripts/ndrank.pl b/scripts/ndrank.pl index cc7c127..e5d152c 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/lib/}; +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});