NAME
WWW::PushBullet - Module giving easy access to PushBullet API
DESCRIPTION
Module giving easy access to PushBullet API
SYNOPSIS
use WWW::PushBullet;
my $pb = WWW::PushBullet->new({apikey => $apikey});
$pb->push_address({ device_iden => $device_iden, name => $name,
address => $address });
$pb->push_file({ device_iden => $device_iden, file => $filename);
$pb->push_link({ device_iden => $device_iden, title => $title,
url => $url });
$pb->push_list({ device_iden => $device_iden, title => $title,
items => \@items });
$pb->push_note({ device_iden => $device_iden, title => $title,
body => $body });
SUBROUTINES/METHODS
new($params)
Creates a new instance of PushBullet API
my $pb = WWW::PushBullet->new({apikey => $apikey});
DEBUG
Prints Debug message when '_debug' is enabled
api_key()
Returns current PushBullet API key
my $apikey = $pb->api_key();
debug_mode
Sets Debug mode
$pb->debug_mode(1);
contacts()
Returns list of contacts
my $contacts = $pb->contacts();
foreach my $c (@{$contacts})
{
printf "Contact '%s' (%s) => %s\n", $c->{name}, $c->{iden}, $c->{email};
}
devices()
Returns list of devices
my $devices = $pb->devices();
foreach my $d (@{$devices})
{
printf "Device '%s' (%s)=> id %s\n",
$d->{nickname}, $d->{model}, $d->{iden};
}
_pushes($content)
Generic pushes function (not supposed to be used directly)
_upload_request($file_name, $file_type)
Upload request to AWS (used by push_file)
push_address($params)
Pushes address (with name & address)
$pb->push_address(
{
device_iden => $device_iden,
name => 'GooglePlex',
address => '1600 Amphitheatre Pkwy, Mountain View, CA 94043, Etats-Unis'
}
);
push_file($params)
Pushes file
$pb->push_file(
{
device_iden => $device_iden,
file_name => '/var/www/index.html',
body => 'File Description'
}
);
push_link($params)
Pushes link (with title & url)
$pb->push_link(
{
device_iden => $device_iden,
title => 'WWW::PushBullet Perl module on GitHub',
url => 'https://github.com/sebthebert/WWW-PushBullet'
}
);
push_list($params)
Pushes list (with title & items)
$pb->push_list(
{
device_iden => $device_iden,
title => 'One list with 3 items',
items => [ 'One', 'Two', 'Three' ]
}
);
push_note($params)
Pushes note (with title & body)
$pb->push_note(
{
device_iden => $device_iden,
title => 'Note Title',
body => 'Note Body'
}
);
version()
Returns WWW::PushBullet module version
LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
REPOSITORY
https://github.com/sebthebert/WWW-PushBullet
AUTHOR
Sebastien Thebert <www-pushbullet@onetool.pm>