The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WWW::Opentracker::Stats - Perl module for retrieve statistics from Opentracker

SYNOPSIS

    use WWW::Opentracker::Stats;

    my $ot_stats = WWW::Opentracker::Stats->new({
        'statsurl'      => 'http://localhost:6969/stats',
    });

    my $stats_ref = $ot_stats->stats(qw/tpbs peer/);

    my $tpbs_stats  = $stats_ref->{'tpbs'};

    print "Downloads:\n";
    while (my ($torrent, $tstats) = each %{ $tpbs_stats->{'files'} }) {
        print "$torrent: " . $tstats->{'downloaded'} . "\n";
    }

DESCRIPTION

Provides an easy to use interface to retrieve various statistics from "opentracker", a BitTorrent tracker.

It executes HTTP requests to opentrackers web services, parses the response and returns data structures that you can easily extract data from, to store it in a database or display it on the web.

METHODS

new

 Args: $class, $args

Constructor. Creates a new instance of the class.

It takes a HASH/HASHREF of arguments. - statsurl (mandatory) - useragent (optional)

default_useragent

 Args: $self

Creates a default user agent that can be used to fetch statistics from opentracker. See "default" in WWW::Opentracker::Stats::UserAgent for details.

params

 Args: $self

Returns a HASHREF with properties that can be passed on to the constructor of the statistics mode packages.

available_modes

Returns all the available modes as an array.

SEE ALSO

WWW::Opentracker::Stats::Mode

Opentracker: http://erdgeist.org/arts/software/opentracker/.

AUTHOR

Knut-Olav Hoven, <knutolav@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2009 by Knut-Olav Hoven

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.