X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=scripts%2Fndrank.pl;h=acb1405d3a282ede1bcd1adf73e1746b1dcbdebf;hb=64bdde3313377c96ab60ebbd311b46277d2764b2;hp=cc7c12767e190b8681de3b72f44cdc663703998d;hpb=c643b311c8f134a59625192b900aa28b3f12d4f1;p=ndwebbie.git diff --git a/scripts/ndrank.pl b/scripts/ndrank.pl index cc7c127..acb1405 100755 --- a/scripts/ndrank.pl +++ b/scripts/ndrank.pl @@ -27,15 +27,12 @@ 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 FindBin; +use lib "$FindBin::Bin/../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});