RSION = '0.0206';
use strictures 2;
use Carp qw(croak);
use Mojo::UserAgent ();
use Mojo::JSON qw(decode_json);
use Mojo::URL ();
use Moo;
use Try::Tiny;
use namespace::clean;
has api_key => (
,
default => sub { 'track' },
);
has format => (
is => 'ro',
default => sub { 'json' },
);
has base => (
is => 'rw',
default => sub { 'http://ws.audioscrobbler.com' }
ss ) {
my $body = $res->body;
if ($self->format eq 'json') {
try {
$data = decode_json($body);
}
catch {
croak $bod