NAME
WebService::Pixabay - Perl 5 interface to Pixabay API.
VERSION
version 1.0.0
SYNOPSIS
use WebService::Pixabay;
my $pix = WebService::Pixabay->new(api_key => 'secret');
default searches
my $img_search = $pix->image_search();
my $vid_search = $pix->video_search();
# show data structure using Data::Printer pretty print.
$img_search->show_data_structure;
$vid_search->show_data_structure;
###################################################
# The parameters of the method have the same name #
# and default values as in Pixabay API docs #
###################################################
# example custom image search and printing
my $nis = $pix->image_search(
q => 'cats dog',
lang => 'es',
response_group => 'high_resolution',
image_type => 'illustration',
category => 'animals',
safesearch => 'true',
order => 'latest',
page => 2,
per_page => 5,
pretty => 'true'
);
$nis->show_data_structure;
# -or-
# example custom video search and printing
my $nvs = $pix->video_search(
q => 'tree',
lang => 'en',
pretty => 'false',
page => 3,
order => 'popular'
)->show_data_structure;
# Handling specific hash and arrays of values from the JSON
# example retrieving webformatURL from each arrays
my @urls = undef;
# note the 'json_data' object usage
foreach my $url (@{$nis->json_data->{hits}}) {
# now has link of photo urls (non-preview photos)
push(@urls, $url->{webformatURL});
}
say $urls[3]; # image URL
# Getting a specific single key or array value
say $nis->image_search(q => 'cloud')
->json_data
->{hits}[2]{webformatURL};
NAME
WebService::Pixabay - Perl 5 interface to Pixabay API.
VERSION
version 0.1.0
SEE ALSO
AUTHOR
faraco <skelic3@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2017 by faraco.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
AUTHOR
faraco <skelic3@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2017 by faraco.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.