in reply to Quick and Dirty Seti@home Server Status
Nice, although you can extract more interesting data than
that with Seti's XML interface. I have a couple of quick
and nasty scripts that return information on your standings.
The first script gives your individual rank, the second script shows the status of the team of your choice. Enjoy.
getstat.pl (single user)
_______________________________________________________
Remember that amateurs built Noah's Ark. Professionals built the Titanic.
getstat.pl (single user)
getstats.pl (team info)#!/usr/bin/perl -w # ==================================================================== +== # Project: Seti@Home # Project Leader: Peter Wise # -------------------------------------------------------------------- +-- # Program name: GetStat # Program state: pre-alpha # Program notes: Pull stats on a seti user using XML interface # # Program filename: getstat.pl # -------------------------------------------------------------------- +-- # Version Author Date Comment # ~~~~~~~~ ~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~ # 1.0 P.J.Wise 10/02/2003 Initial version # # -------------------------------------------------------------------- +-- # CVS: # ID: $Id: getstat.pl,v 1.1 2003/02/10 02:32:04 peter Exp $ # Author: $Author: peter $ # Date: $Date: 2003/02/10 02:32:04 $ # Revision: $Revision: 1.1 $ # # -------------------------------------------------------------------- +-- # Notes: # ~~~~~~ # # ==================================================================== +== use strict; use LWP::Simple qw/get/; use XML::Simple; use Data::Dumper; #Config my $TARGET_EMAIL = $ARGV[0] || 'youremail@yourdomain'; my $TARGET_URL = "http://setiathome.ssl.berkeley.edu/fcgi-bin/fcgi?cmd +=user_xml&email=$TARGET_EMAIL"; print "Getting data from server..."; if ( my $data = get($TARGET_URL)){ print "Done\nProcessing..."; my $ref_data = XMLin($data); print "Done\n\n"; print "Number of Results: $ref_data->{userinfo}{numresults}\n" +; print " Last Result: $ref_data->{userinfo}{lastresulttime +}\n"; print " Rank: $ref_data->{rankinfo}{rank} / $ref_d +ata->{rankinfo}{ranktotalusers} (". (100-$ref_data->{rankinfo}{top_r +ankpct})."%)\n"; }else{ print "Failed\n"; }
#!/usr/bin/perl -w # ==================================================================== +== # Project: Seti@Home # Project Leader: Peter Wise # -------------------------------------------------------------------- +-- # Program name: GetStats # Program state: pre-alpha # Program notes: Pull stats on a seti user using XML interface # # Program filename: getstats.pl # -------------------------------------------------------------------- +-- # Version Author Date Comment # ~~~~~~~~ ~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~ # 1.0 P.J.Wise 10/02/2003 Initial version # # -------------------------------------------------------------------- +-- # CVS: # ID: $Id: getstats.pl,v 1.1 2003/02/10 02:32:04 peter Exp $ # Author: $Author: peter $ # Date: $Date: 2003/02/10 02:32:04 $ # Revision: $Revision: 1.1 $ # # -------------------------------------------------------------------- +-- # Notes: # ~~~~~~ # # ==================================================================== +== use strict; use LWP::Simple qw/get/; use XML::Simple; use Data::Dumper; #Config my $TARGET_NAME= $ARGV[0] || 'YourTeamNameHere'; my $TARGET_URL = "http://setiathome.ssl.berkeley.edu/fcgi-bin/fcgi?cmd +=team_lookup_xml&name=$TARGET_NAME"; $= = 20; my ($nnn,$ccc,$rrr); format STDOUT_TOP = Stats Pos. Name Results ------------------------------------------------------------------- . format STDOUT = @>> @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @>>>>>>> $ccc, $nnn, $rrr . #print "Getting data from server..."; if ( my $data = get($TARGET_URL)){ #print "Done\nProcessing..."; my $ref_data = XMLin($data); #print "Done\n\n"; my $members = $ref_data->{topmembers}{member}; my $count = 0; foreach my $name (sort {$members->{$b}{numresults}<=>$members- +>{$a}{numresults}} keys %$members){ $count++; $nnn = $name; $ccc = $count; $rrr = $members->{$name}{numresults}; write(); } }else{ print "Failed\n"; }
_______________________________________________________
Remember that amateurs built Noah's Ark. Professionals built the Titanic.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Quick and Dirty Seti@home Server Status
by Mr. Muskrat (Canon) on Apr 07, 2003 at 15:06 UTC |
In Section
Cool Uses for Perl