WebService::Pixela::Pixel - It's Pixela Webhook API client
use strict; use warnings; use WebService::Pixela; my $pixela = WebService::Pixela->new(token => $ENV{TOKEN}, username => $ENV{USERNAME}); # set graph id $pixela->graph->id('anatofuz-test'); $pixela->pixel->get(date => '20180915'); $pixela->pixel->update(date => '20180915', quantity => 50); $pixela->pixel->increment(date => '20180915'); $pixela->pixel->decrement(date => '20180915'); $pixela->pixel->get(date => '20180915'); $pixela->pixel->delete(date => '20180915');
WebService::Pixela::Pixel is user API client about Pixe.la webservice.
This instance method require WebService::Pixela instance. So, Usually use these methods from the WebService::Pixela instance.
WebService::Pixela
$pixela->pixel->post(%opts)
It records the quantity of the specified date as a "Pixel".
%opts might be:
([required]) id : Str
Specify the target graph as an ID. If the graph id is set for an instance, it will be automatically used. (You do not need to enter it as an argument)
[required] date : [yyyyMMdd]
The date on which the quantity is to be recorded. It is specified in yyyyMMdd format.
[required] quantity : String
Specify the quantity to be registered on the specified date. Validation rule: int^-?[0-9]+ float^-?[0-9]+.[0-9]+
optional_data : json_string
Additional information other than quantity. It is specified as JSON string. The amount of this data must be less than 10 KB.
https://docs.pixe.la/#/post-pixel
$pixela->pixel->get(%opts)
Get registered quantity as "Pixel".
https://docs.pixe.la/#/get-pixel
$pixela->pixel->update(%opts)
Update the quantity already registered as a "Pixel". If target "Pixel" not exist, create a new "Pixel" and set quantity.
quantity : String
https://docs.pixe.la/#/put-pixel
$pixela->pixel->increment(%opts)
Increment quantity "Pixel" of the day (it is used "timezone" setting if Graph's "timezone" is specified, if not specified, calculates it in "UTC"). If the graph type is int then 1 added, and for float then 0.01 added.
length : Int (default 0)
Since the request body is not specifield, specify the Content-Length header. (Default 0)
https://docs.pixe.la/#/increment-pixel
$pixela->pixel->decrement(%opts)
Decrement quantity "Pixel" of the day (it is used "timezone" setting if Graph's "timezone" is specified, if not specified, calculates it in "UTC"). If the graph type is int then -1 added, and for float then -0.01 added.
https://docs.pixe.la/#/decrement-pixel
$pixela->pixel->delete(%opts)
Delete the registered "Pixel".
https://docs.pixe.la/#/delete-pixel
Copyright (C) Takahiro SHIMIZU.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Takahiro SHIMIZU <anatofuz@gmail.com>
To install WebService::Pixela, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Pixela
CPAN shell
perl -MCPAN -e shell install WebService::Pixela
For more information on module installation, please visit the detailed CPAN module installation guide.