if $^V >= v5.38, warnings => 'experimental::class';
use Net::LastFM;
use Getopt::Long;
use JSON;
our $VERSION = '0.0.10';
field $username :param = 'davorg';
field $period :param =
artists;
field $renderer = {
text => \&render_text,
html => \&render_html,
json => \&render_json,
};
method run {
GetOptions(
'user=s' => \$username,
'period=s
method render_json {
my $pos = 1;
my @data = map { {
position => $pos++,
name => $_->{name},
count => $_->{playcount},
} } @artists;
say JSON->new->canonica