package WWW::ProximoBus;
use strict;
use warnings;
use Any::Moose;
use Carp;
use JSON;
use LWP::UserAgent;
our $VERSION = '0.01';
has 'api_host' => ( is => 'rw', default => 'proximobus.appspot.com
_for($path);
my $res = $self->ua->get($uri);
if ($res->is_success) {
return JSON::decode_json($res->content);
}
else {
die "ProximoBus HTTP error " . $res->code . ": "
gency.json";
return $self->get($path);
}
sub routes {
my $self = shift;
my ($agency) = @_;
croak "need an agency" unless ($agency);
my $path = "/agencies/$agency/routes.json";