SETI::WebStats - Gather SETI@home statistics from the SETI@home web server
use SETI::WebStats; my $emailAddr = "foo\@bar.org"; my $seti = SETI::WebStats->new($emailAddr); my $ranking = $seti->rank; my $unitsProcd = $seti->numResults; my $userInfo = $seti->userInfo; for (keys(%$userInfo)) { print $_, "->", $userInfo->{$_}, "\n"; }
A simple Perl interface to the SETI@home web server. The SETI::WebStats module queries the SETI@home web server to retrieve user statistics. The data availible from the server is similar to that displayed on the Individual User Statistics web page. In order to query the server, you will need a valid SETI@home account i.e e-mail address. At this time only user statistics are availible. A later version might incorporate country/group statistics also.
SETI::WebStats
Individual User Statistics
This returns the statistics object. It takes a mandatory e-mail address as it's only argument:
my $stats = SETI::WebStats->new($emailAddr);
The new method will query the the SETI@home server and parse the retrieved XML via two internal methods _getStats and _parseXML.
new
_getStats
_parseXML
The userInfo method will return a hash reference of user information:
userInfo
my $userInfo = $stats->userInfo;
The hash reference looks like this:
$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'};
The rankInfo method will return a hash reference of rank information:
rankInfo
my $rankInfo = $stats->rankInfo;
$rankInfo = { num_samerank => '3', ranktotalusers => '4152567', top_rankpct => '0.516', rank => '21410'};
Each User statistic can also be accessed individually via the following methods:
my $userTime = $stats->userTime;
my $aveCpu = $stats->aveCpu;
my $procd = $stats->numResults;
my $registerDate = $stats->regDate;
my $dailyResults = $stats->resultsPerDay;
my $lastUnit = $stats->lastResultTime;
my $cpuTime = $stats->cpuTime;
my $accountName = $stats->name;
Each Rank statistic can also be accessed individually via the following methods:
my $usersWithSameRank = $stats->haveSameRank;
my $totalUsers = $stats->totalUsers;
my $percent = $stats->rankPercent;
my $rank = $stats->rank;
Needs a little work. Remove hardcoding of URL. Add country/group statistics. Add meaningful tests. All will be addressed in upcoming releases.
Kevin Spencer <vek@{NOSPAM}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.