ast, almanac, satellite and radar maps, etc.
=head1 SYNOPSIS
Connect to the Weather Underground JSON/XML webservice
and parse the response data into something usable.
The entire response is availab
t result from the most recent API call. This will be either xml or json depending on api_type.
You can also set this to whatever json/xml you'd like, though I can't imagine why you'd want to.
=head2
ns raw xml result from wunderground server where applicable
=head2 json()
*Deprecated* - use L</"raw()"> instead.
Returns raw json result from wunderground server where applicable
=head2 data()
C
package WWW::Wunderground::API;
use 5.006;
use Moo;
use URI;
use JSON::MaybeXS;
use LWP::Simple;
use XML::Simple;
use Hash::AsObject;
=head1 NAME
WWW::Wunderground::API - Interface to Weather Under
||$ENV{WUNDERGROUND_KEY} });
has api_type => (is=>'rw', lazy=>1, default=>sub { $_[0]->api_key ? 'json' : 'xml' });
has cache => (is=>'ro', lazy=>1, default=>sub { WWW::Wunderground::API::BadCache->ne
ta => (is=>'rw', lazy=>1, default=>sub{ Hash::AsObject->new } );
sub json {
my $self = shift;
return $self->api_type eq 'json' ? $self->raw : undef;
}
sub xml {
my $self = shift;
return $sel