]> ruin.nu Git - ndwebbie.git/blobdiff - scripts/ndrank.pl
Use ND::DB module instead of db.pl
[ndwebbie.git] / scripts / ndrank.pl
index cc7c12767e190b8681de3b72f44cdc663703998d..be8b1cc4f99f0cd084770c961984c97d1722290d 100755 (executable)
@@ -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});