Kevin Spencer > SETI-WebStats-1.02 > SETI::WebStats

Download:
SETI-WebStats-1.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.01   Source   Latest Release: SETI-WebStats-1.03

NAME ^

SETI::WebStats - Gather SETI@home statistics from the SETI@home web server

SYNOPSIS ^

  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";
  }

DESCRIPTION ^

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.

METHODS ^

new

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.

userInfo

The userInfo method will return a hash reference of user information:

  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'};

rankInfo

The rankInfo method will return a hash reference of rank information:

  my $rankInfo = $stats->rankInfo;

The hash reference looks like this:

  $rankInfo = {
        num_samerank   => '3',
        ranktotalusers => '4152567',
        top_rankpct    => '0.516',
        rank           => '21410'};

User Methods ^

Each User statistic can also be accessed individually via the following methods:

userTime

  my $userTime = $stats->userTime;

aveCpu

  my $aveCpu = $stats->aveCpu;

numResults

  my $procd = $stats->numResults;

regDate

  my $registerDate = $stats->regDate;

resultsPerDay

  my $dailyResults = $stats->resultsPerDay;

lastResultTime

  my $lastUnit = $stats->lastResultTime;

cpuTime

  my $cpuTime = $stats->cpuTime;

name

  my $accountName = $stats->name;

Rank Methods ^

Each Rank statistic can also be accessed individually via the following methods:

haveSameRank

  my $usersWithSameRank = $stats->haveSameRank;

totalUsers

  my $totalUsers = $stats->totalUsers;

rankPercent

  my $percent = $stats->rankPercent;

rank

  my $rank = $stats->rank;

TO DO ^

Needs a little work. Remove hardcoding of URL. Add country/group statistics. Add meaningful tests. All will be addressed in upcoming releases.

AUTHOR ^

Kevin Spencer <vek@{NOSPAM}perlmonk.org>

SEE ALSO ^

perl, SETI::Stats, http://setiathome.ssl.berkeley.edu.

syntax highlighting: