Scripting Examples for Mulitple Top10 Outputs

From Geoqo
(Difference between revisions)
Jump to: navigation, search
Line 149: Line 149:
 
     1    1 4.5
 
     1    1 4.5
 
     1    1 1.5
 
     1    1 1.5
 +
 +
 +
{{TRICKS}}

Revision as of 03:45, 30 March 2007

brdad wanted to do this:

 I'd like to list the top ten cache placers, and for each of those placers, I'd like to have the stats for their placed caches.

Which can functionally be done with a script called multiple times. (ie, geoqo can't do exactly what he wants in one pass; there's a todo item!)

Create a script in $HOME/.geoqo/scripts/mytop10 that looks like:

 %search
 cache:owner_name==%[Owner]

 %print
 ======================================================================
 %print
 STATS FOR CACHES MADE BY %[Owner]

 %display
 top10:groundspeak_container

 %display
 top10:groundspeak_difficulty

 %display
 top10:groundspeak_terrain

Then you can run the script on multiple people by hand:

 > geoqo -x mytop10:Owner=Spelunk
 ======================================================================
 STATS FOR CACHES MADE BY Spelunk
 Top 10 'groundspeak_container's
  Num    % Value
 ----------------------------------------------------------------------
    8   40 Small
    4   20 Regular
    4   20 Micro
    3   15 Other
    1    5 Not chosen
 Top 10 'groundspeak_difficulty's
  Num    % Value
 ----------------------------------------------------------------------
    7   35 1.5
    5   25 2
    4   20 3
    2   10 1
    1    5 4
    1    5 2.5
 Top 10 'groundspeak_terrain's
  Num    % Value
 ----------------------------------------------------------------------
    8   40 1
    6   30 1.5
    4   20 2
    2   10 2.5

You could also creat a script to run that script multiple times for a given set of people, say in $HOME/.geoqo/scripts/mytop10s (note the ending 's').

 %script
 mytop10:Owner=Spelunk
 %script
 mytop10:Owner=Yamar
 %script
 mytop10:Owner=47Dad47

Then you could call that for everyone quickly:

 > geoqo -x mytop10s
 ======================================================================
 STATS FOR CACHES MADE BY Spelunk
 Top 10 'groundspeak_container's
  Num    % Value
 ----------------------------------------------------------------------
    8   40 Small
    4   20 Regular
    4   20 Micro
    3   15 Other
    1    5 Not chosen
 Top 10 'groundspeak_difficulty's
  Num    % Value
 ----------------------------------------------------------------------
    7   35 1.5
    5   25 2
    4   20 3
    2   10 1
    1    5 4
    1    5 2.5
 Top 10 'groundspeak_terrain's
  Num    % Value
 ----------------------------------------------------------------------
    8   40 1
    6   30 1.5
    4   20 2
    2   10 2.5
 ======================================================================
 STATS FOR CACHES MADE BY Yamar
 Top 10 'groundspeak_container's
  Num    % Value
 ----------------------------------------------------------------------
   17   47 Micro
   13   36 Regular
    4   11 Small
    1    2 Not chosen
    1    2 Other
 Top 10 'groundspeak_difficulty's
  Num    % Value
 ----------------------------------------------------------------------
   14   38 2
    9   25 1.5
    6   16 1
    3    8 2.5
    2    5 3
    1    2 4
    1    2 3.5
 Top 10 'groundspeak_terrain's
  Num    % Value
 ----------------------------------------------------------------------
   16   44 1.5
   15   41 1
    5   13 2
 ======================================================================
 STATS FOR CACHES MADE BY 47Dad47
 Top 10 'groundspeak_container's
  Num    % Value
 ----------------------------------------------------------------------
   33   54 Regular
   22   36 Micro
    2    3 Not chosen
    2    3 Small
    2    3 Large
 Top 10 'groundspeak_difficulty's
  Num    % Value
 ----------------------------------------------------------------------
   28   45 2
   14   22 1
   13   21 3
    3    4 2.5
    1    1 4
    1    1 3.5
    1    1 1.5
 Top 10 'groundspeak_terrain's
  Num    % Value
 ----------------------------------------------------------------------
   22   36 1
   11   18 2
   11   18 4
   10   16 3
    3    4 3.5
    2    3 2.5
    1    1 4.5
    1    1 1.5


Tips and Tricks

Personal tools