Weewar
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Weewar.pm view on Meta::CPAN
for everything except the HQ (and no state needs to be kept between
requests). If this changes, then this API will change a bit.
=cut
{ package Weewar::UA;
use base 'LWP::UserAgent';
sub new {
my ($class, $args) = @_;
$args ||= {};
bless $args => $class;
}
sub get_basic_credentials {
my $self = shift;
return unless $self->{username};
return (map {$self->{$_}} qw/username password/);
}
}
# separate method so that WeewarTest can override the HTTP part
sub _get {
lib/Weewar/HQ.pm view on Meta::CPAN
=cut
sub new {
my ($class, $args) = @_;
croak 'need hashref of args' unless ref $args eq 'HASH';
croak 'need key' unless $args->{key};
croak 'need user' unless $args->{user};
my $self = bless $args => $class;
# get XML
my $xml = Weewar->_request('headquarters', { username => $args->{user},
password => $args->{key},
});
my @game_nodes = $xml->findnodes('/games/game');
my @needs_attention;
my @games;
for my $game_node (@game_nodes){
view all matches for this distributionview release on metacpan - search on metacpan
( run in 1.627 second using v1.00-cache-2.02-grep-82fe00e-cpan-48ebf85a1963 )