use File::Basename qw{basename};
use Getopt::Std qw{getopts};
use Tie::IxHash qw{};
use JSON::XS qw{encode_json};
use Time::HiRes qw{};
use WebService::Whistle::Pet::Tracker::API qw{};
require Net::M
'} );
$count++ if $mqtt->publish("$topic/last_location" => encode_json(\%location) );
$count++ if $mqtt->publish("$topic/device/battery_level" => $pet->
package WebService::Whistle::Pet::Tracker::API;
use strict;
use warnings;
use JSON::XS qw{};
use HTTP::Tiny qw{};
our $VERSION = '0.03';
our $PACKAGE = __PACKAGE__;
our $API_URL = 'https://app.whistl
$pet (@$pets) {
print JSON::XS->new->pretty->encode($pet);
}
=head1 DESCRIPTION
Perl interface to access the Whistle Pet Tracker Web Service. All methods return JSON payloads that are convert
n array instead of a hash like other calls
=head1 METHODS (API)
=head2 api
Returns the decoded JSON data from the given web service end point
my $data = $ws->api('/end_point');
=cut
sub api {
/perl
use strict;
use warnings;
use File::Basename qw{basename};
use Getopt::Std qw{getopts};
use JSON::XS qw{};
use WebService::Whistle::Pet::Tracker::API qw{};
my $basename = basename($0);
my $synt
new(email=>$email, password=>$password);
my $json = JSON::XS->new->pretty;
foreach my $argv (@ARGV) {
my $device = $ws->device($argv);
print $json->encode($device);
}
__END__
=head1 NAME
p
/perl
use strict;
use warnings;
use File::Basename qw{basename};
use Getopt::Std qw{getopts};
use JSON::XS qw{};
use WebService::Whistle::Pet::Tracker::API qw{};
my $basename = basename($0);
my $synt
Pet::Tracker::API->new(email=>$email, password=>$password);
my $json = JSON::XS->new->pretty;
my $pets = $ws->pets;
print $json->encode($pets);
__END__
=head1 NAME
perl-WebService-Whistle-