NAME
WebService::ZombiesRun - Access run information from the Zombies, Run! game
VERSION
version 0.01
SYNOPSIS
my
$zombies
= WebService::ZombiesRun->new(
player
=>
'pjf'
);
my
$runs
=
$zombies
->runs_raw;
foreach
my
$run
(
@$runs
) {
say
"Ran $run->{distance} metres, burning $run->{energy} calories"
;
}
DESCRIPTION
This module provides a thin interface that crawls the Zombies, Run! website for your running stats.
As a thin interface, any method ending with _raw
is simply returning the JSON as used internally by the Zombies, Run! website. These structures may change.
METHODS
runs_raw
my
$runs
=
$zombies
->runs_raw;
foreach
my
$run
(
@$runs
) {
say
"Ran $run->{distance} metres, burning $run->{energy} calories"
;
}
Returns an array reference of run records. These are returned directly translated from the JSON provided by the underlying server.
total_runs
my
$runs
=
$zombies
->total_runs;
Returns the total runs completed by the player.
meta_raw
my
$metadata
=
$zombies
->meta_raw;
Returns the contents of the 'meta' data in the manfiest. At the time of writing, this is returned as a hash in the following form, which is directly interpreted from the JSON returned by the server:
{
'total_count'
=> 12,
'offset'
=> 0,
'limit'
=> 1000,
'previous'
=>
undef
,
'next'
=>
undef
}
SEE ALSO
- zombiesrun
-
Cmdline tool for retrieving information. Also a great proof of concept for using this module.
- Zombies, Run!
-
The Zombies, Run! game.
AUTHOR
Paul Fenwick <pjf@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by Paul Fenwick.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.