Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Quick and Dirty Seti@home Server Status

by vagnerr (Prior)
on Apr 05, 2003 at 13:26 UTC ( #248290=note: print w/ replies, xml ) Need Help??


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)

#!/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"; }
getstats.pl (team info)
#!/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.


Comment on Re: Quick and Dirty Seti@home Server Status
Select or Download Code
Re: Re: Quick and Dirty Seti@home Server Status
by Mr. Muskrat (Abbot) on Apr 07, 2003 at 15:06 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://248290]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2014-09-02 00:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (18 votes), past polls