WebService::Whistle::Pet::Tracker::API - Perl interface to access the Whistle Pet Tracker Web Service
use WebService::Whistle::Pet::Tracker::API; my $ws = WebService::Whistle::Pet::Tracker::API->new(email=>$email, password=>$password); my $pets = $ws->pets; #isa ARRAY of HASHes foreach my $pet (@$pets) { print JSON::XS->new->pretty->encode($pet); }
Perl interface to access the Whistle Pet Tracker Web Service. All methods return JSON payloads that are converted to Perl data structures. Methods that require authentication will request a token and cache it for the duration of the object.
my $ws = WebService::Whistle::Pet::Tracker::API->new(email=>$email, password=>$password);
Sets and returns the registered Whistle account email
Sets and returns the registered Whistle account password
Returns a list of pets as an array reference
my $pets = $ws->pets;
Returns device data for the given device id
my $device = $ws->device('WXX-ABC123'); my $battery_level = $device->{'battery_level'}; #0-100 charge level
Returns dailies for the given pet id
my $pet_dailies = $ws->pet_dailies($pet_id);
Returns the daily items for the given pet id and day number
my $pet_daily_items = $ws->pet_daily_items($pet_id, $day_number);
Returns pet stats for the given pet id
my $pet_stats = $ws->pet_stats(123456789);
Returns registered places as an array reference
my $places = $ws->places;
Returns the decoded JSON data from the given web service end point
my $data = $ws->api('/end_point');
Calls the login service, caches, and returns the response.
Retrieves the authentication token from the login end point
Returns an HTTP::Tiny web client user agent
Michael R. Davis
MIT License
Copyright (c) 2023 Michael R. Davis
To install WebService::Whistle::Pet::Tracker::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Whistle::Pet::Tracker::API
CPAN shell
perl -MCPAN -e shell install WebService::Whistle::Pet::Tracker::API
For more information on module installation, please visit the detailed CPAN module installation guide.