[Home]TheBestScoringBot/DataCollection

Robo Home | TheBestScoringBot | Changes | Preferences | AllPages

I wrote a quick (Java) program that interfaces with [wget] to retrieve all of the latest scores required for this script to run, and which eliminates 99% of the manual labour. Here it is:

   import java.io.*;
    public class BestBotRankingsDownloader{
   /*
   *@author Julian Kent aka Skilgannon
   *A quick script to download all the rating files, used for the TheBestBot ranking
   */
       public static void main(String[] args) throws Exception{
      
         String rumble = "robo";
         String server = "http://rumble.fervir.com/rumble/rankings/";
         String ratingsFile = "ratings_" + rumble + "rumble.txt";
         File subDir = new File("./rankings/");
      
         Process ratingsFileDownload = Runtime.getRuntime().exec(new String[]{"wget","-N",server + ratingsFile}, null, subDir);
         ratingsFileDownload.waitFor();
      
         RandomAccessFile raf = new RandomAccessFile(subDir + "/" + ratingsFile, "r");
         String line = raf.readLine();
         while(line != null){
            if(line.charAt(0) != '#'){
               String bot = line.split("=")[0];
               String botScoresFile = rumble + "rumble_" + bot + ".txt";
               System.out.print("Starting " + bot + ".....");
               Process botScoresDownload = Runtime.getRuntime().exec(new String[]{"wget","-N",server + botScoresFile}, null, subDir);
               botScoresDownload.waitFor();
               System.out.println("complete");
            }
            line = raf.readLine();
         }
         raf.close();
      }
   }

I'm in the process of downloading the files right now... -- Skilgannon


Robo Home | TheBestScoringBot | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited December 19, 2007 13:07 EST by Skilgannon (diff)
Search: