App-LastStats
view release on metacpan or search on metacpan
lib/App/LastStats.pm view on Meta::CPAN
method run {
GetOptions(
'user=s' => \$username,
'period=s' => \$period,
'format=s' => \$format,
'count=i' => \$count,
'api-key=s' => \$api_key,
'api-secret=s'=> \$api_secret,
);
$self->validate;
$self->laststats;
$self->render;
}
method validate {
$period = lc $period;
$format = lc $format;
my @valid_periods = qw(overall 7day 1month 3month 6month 12month);
unless (grep { $_ eq $period } @valid_periods) {
die "Invalid period: $period\n",
'Valid periods are: ', join(', ', @valid_periods), "\n";
}
unless (exists $renderer->{$format}) {
lib/App/LastStats.pm view on Meta::CPAN
=head1 DESCRIPTION
App::LastStats is a module that fetches and displays Last.fm statistics for a given user. It allows you to specify the time period, format, and number of artists to display.
=head1 METHODS
=head2 run
Fetches and displays the Last.fm statistics based on the provided options.
=head2 validate
Validates the provided options.
=head2 render_text
Renders the statistics in plain text format.
=head2 render_json
Renders the statistics in JSON format.
( run in 0.334 second using v1.01-cache-2.11-cpan-beeb90c9504 )