Acme-Free-Dog-API
view release on metacpan or search on metacpan
of the Copyright Holder as specified below.
"Copyright Holder" is whoever is named in the copyright or
copyrights for the package.
"You" is you, if you're thinking about copying or distributing
this Package.
"Reasonable copying fee" is whatever you can justify on the
basis of media cost, duplication charges, time of people involved,
and so on. (You will not be required to justify it to the
Copyright Holder, but only to the computing community at large
as a market that must bear the fee.)
"Freely Available" means that no fee is charged for the item
itself, though there may be fees involved in handling the item.
It also means that recipients of the item may redistribute it
under the same conditions they received it.
1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
return EXIT_SUCCESS;
}
# fletch sub-breeds --breed BREED #(req'd)
sub do_subbreeds {
my ($ARGV) = @_;
my $o = Getopt2h2o $ARGV, {}, qw/breed=s/;
# require --breed
if ( not $o->breed ) {
warn "FATAL: --breed BREED, is required\n";
return EXIT_ERROR;
}
my $dogs = $fletch->subbreeds( breed => $o->breed );
printf STDERR "Found %d subbreed%s for %s\n", scalar @$dogs, ( scalar @$dogs != 1 ) ? "s" : "", $o->breed;
foreach my $subbreed ( sort { $a cmp $b } @$dogs ) {
printf "%s\n", $subbreed;
}
return EXIT_SUCCESS;
}
# fletch images --breed BREED #(req'd)
# fletch breeds | xargs -I% fletch images --breed %
sub do_images {
my ($ARGV) = @_;
my $o = Getopt2h2o $ARGV, {}, qw/breed=s/;
# require --breed
if ( not $o->breed ) {
warn "FATAL: --breed BREED, is required\n";
return EXIT_ERROR;
}
my $images = $fletch->images( breed => $o->breed );
foreach my $url ( $images->all ) {
say $url;
}
return EXIT_SUCCESS;
lib/Acme/Free/Dog/API.pm view on Meta::CPAN
This command can be used in combination with the C<subbreeds> subcommand, e.g.,
fletch breeds | awk '{ if ($2 == "+") print $1 }' | xargs -I% fletch subbreeds --breed %
In fact, any subcommand that takes that C<--breed> argument can be combined with
this subcommand in a way that makes for some very powerful commandline dog-fu!
=item C<images --breed BREED>
The C<--breed> argument is required.
Provides a list of all URLs for the specified C<BREED>. The API call behind this subcommand
doesn't support listing image URLs by subbreed, so for breeds that are further categorized
by subbreed the results contain a mix of them.
This comand can be used incombination with the C<breeds> subcommand to get a bunch of images
for each breed (no support in the API for subbreed image fetching).
fletch breeds | awk '{print $1}' | xargs -I% fletch images --breed %
lib/Acme/Free/Dog/API.pm view on Meta::CPAN
Prints the random dog image URL to C<STDOUT>. You may optionally specify a breed.
This command can be used in combination with the C<breeds> command to get a random image
URL for all breeds.
fletch breeds | awk '{print $1}' | xargs -I% fletch random --breed %
=item C<subbreeds --breed BREED>
The C<--breed> argument is required.
Given a breed, lists out the subbreeds. It handles breeds that have no subbreeds, but this
command can be used in combination with the C<breeds> command to fetch all subbreeds for
only breeds that have 1 or more subbreeds. See the section on the C<breeds> subcommand
for more..
=back
=head2 Internal Methods
There are no internal methods to speak of.
=head1 ENVIRONMENT
Nothing special required.
=head1 AUTHOR
Brett Estrade L<< <oodler@cpan.org> >>
=head1 BUGS
Please report.
=head1 LICENSE AND COPYRIGHT
t/release-kwalitee.t view on Meta::CPAN
unless ($ENV{RELEASE_TESTING}) {
print qq{1..0 # SKIP these tests are for release candidate testing\n};
exit
}
}
use Test::More;
eval "use Test::Kwalitee";
plan skip_all => "Test::Kwalitee required for testing kwalitee"
if $@;
( run in 0.527 second using v1.01-cache-2.11-cpan-0a6323c29d9 )