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_id => $device_id, name => $name, 
    address => $address });
    
$pb->push_file({ device_id => $device_id, file => $filename);
    
$pb->push_link({ device_id => $device_id, title => $title,
    url => $url });
    
$pb->push_list({ device_id => $device_id, title => $title, 
    items => \@items });
    
$pb->push_note({ device_id => $device_id, 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);

devices()

Returns list of devices

my $devices = $pb->devices();

foreach my $d (@{$devices})
{
    printf "Device '%s' => id %s\n", $d->{extras}->{model}, $d->{id};
}

_pushes($content)

Generic pushes function (not supposed to be used directly)

push_address($params)

Pushes address (with name & address)

$pb->push_address(
    {
        device_id => $device_id,
        name      => 'GooglePlex',
        address   => '1600 Amphitheatre Pkwy, Mountain View, CA 94043, Etats-Unis'
    }
    );

push_file($params)

Pushes file

$pb->push_file({ device_id => $device_id, file => '/var/www/index.html' });

push_link($params)

Pushes link (with title & url)

$pb->push_link(
    {
        device_id => $device_id,
        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_id => $device_id,
        title     => 'One list with 3 items',
        items     => [ 'One', 'Two', 'Three' ]
    }
    );

push_note($params)

Pushes note (with title & body)

$pb->push_note(
    {
        device_id => $device_id,
        title     => 'Note Title',
        body      => 'Note Body'
    }
    );

version()

Returns WWW::PushBullet module version

AUTHOR

Sebastien Thebert <stt@ittool.org>