SETI::WebStats - Gather SETI@home statistics from the SETI@home web server
use SETI::WebStats; my $seti = SETI::WebStats->new; # get individual user statistics... if ($seti->fetchUserStats('foo@bar.org')) { print "My rank current rank is " . $seti->rank, "\n"; print "I have processed " . $seti->numResults . " units."; } my $cpuTime = $seti->cpuTime; my $userInfo = $seti->userInfo; for (keys(%$userInfo)) { print $_, "->", $userInfo->{$_}, "\n"; } # get group statistics... if ($seti->fetchGroupStats('perlmonks')) { print $seti->groupFounderName . " founded the group.\n"; print "We have " . $seti->numGroupMembers . "members.\n"; print "We've processed " . $seti->numGroupResults . " units.\n"; print "For a total group CPU time of " . $seti->totalGroupCPU; }
A simple Perl interface to SETI@home User & Group statistics.
The SETI::WebStats module queries the SETI@home web server to retrieve user and group statistics via XML. The data availible from the server is the same as that displayed on the Individual User Statistics and Group Statistics web pages. In order to query the server, you will need a valid SETI@home account (i.e email address) or valid group name.
SETI::WebStats
Individual User Statistics
Group Statistics
Load the module as normal.
use SETI::WebStats
Create a WebStats object.
my $seti = SETI::WebStats->new;
$seti->fetchUserStats('foo@bar.org');
The fetchUserStats method takes a mandatory email address as it's only argument. The SETI@home web server will be queried and the XML output parsed. Returns 1 on success, 0 on failure.
fetchUserStats
You can then extract the user stats in one go:
my $userInfo = $seti->userInfo;
Returns a hash reference:
$userInfo = { usertime => '3.530 years', avecpu => '15 hr 54 min 36.3 sec', numresults => '670', regdate => 'Fri May 28 20:28:45 1999', resultsperday => '0.51', lastresulttime => 'Sat Jun 8 03:47:50 2002', cputime => ' 1.217 years', name => 'John Doe'};
Alternatively, instead of calling userInfo, you can extract each user statistic individually:
userInfo
my $userTime = $seti->userTime; my $aveCpu = $seti->aveCpu; my $procd = $seti->numResults; my $registerDate = $seti->regDate; my $dailyResults = $seti->resultsPerDay; my $lastUnit = $seti->lastResultTime; my $cpuTime = $seti->cpuTime; my $accountName = $seti->name;
You can extract rank stats in one go:
my $rankInfo = $seti->rankInfo;
$rankInfo = { num_samerank => '3', ranktotalusers => '4152567', top_rankpct => '0.516', rank => '21410'};
Alternatively, instead of calling rankInfo, you can extract each rank statistic individually:
rankInfo
my $usersWithSameRank = $seti->haveSameRank; my $totalUsers = $seti->totalUsers; my $percentComparedTo = $seti->rankPercent; my $rank = $seti->rank;
$seti->fetchGroupStats('some_group_name');
The fetchGroupStats method takes a mandatory group name as it's only argument. The SETI@home web server will be queried and the XML output parsed. Returns 1 on success, 0 on failure.
fetchGroupStats
You can then extract each group statistic.
my $groupName = $seti->groupName; my $groupURL = $seti->groupURL; my $founder = $seti->groupFounderName; my $founderURL = $seti->groupFounderURL; my $groupResults = $seti->numGroupResults; my $groupMembers = $seti->numGroupMembers; my $groupCPU = $seti->totalGroupCPU;
None that I'm aware of but be sure to let me know if you find one.
Kevin Spencer <vek@perlmonk.org>
perl, SETI::Stats, http://setiathome.ssl.berkeley.edu.
To install SETI::WebStats, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SETI::WebStats
CPAN shell
perl -MCPAN -e shell install SETI::WebStats
For more information on module installation, please visit the detailed CPAN module installation guide.