The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WebService::Pushover - interface to Pushover API

VERSION

This document describes WebService::Pushover version 0.1.2.

SYNOPSIS

    use WebService::Pushover;

    my $push = WebService::Pushover->new
        or die( "Unable to instantiate WebService::Pushover.\n" );

    my %params = (
        token => 'PUSHOVER API TOKEN',
        user => 'PUSHOVER USER TOKEN',
        message => 'test test test',
    );

    my $status = $push->message( %params );

DESCRIPTION

This module provides a Perl wrapper around the Pushover ( http://pushover.net ) RESTful API. You'll need to register with Pushover to obtain an API token for yourself and for your application before you'll be able to do anything with this module.

INTERFACE

new()

Accepts a single parameter, debug. Set this to a true value in order to enable tracing of Net::HTTP::Spore operations.

debug()

debug() returns 1 if debugging is enabled, and 0 otherwise.

message(%params)

message() sends a message to Pushover and returns a scalar reference representation of the message status. The following are valid parameters:

token REQUIRED

The Pushover application token, obtained by registering at http://pushover.net/apps.

user REQUIRED

The Pushover user token, obtained by registering at http://pushover.net.

device OPTIONAL

The Pushover device name; if not supplied, the user will be validated if at least one device is registered to that user.

title OPTIONAL

A string that will appear as the title of the message; if not supplied, the name of the application registered to the application token will appear.

message REQUIRED

A string that will appear as the body of the message.

timestamp OPTIONAL

The desired message timestamp, in Unix epoch seconds.

priority OPTIONAL

Set this value to "2" to mark the message as emergency priority, "1" to mark the message as high priority, set it to "-1" to mark the message as low priority, or set it to "0" or leave it unset for standard priority.

retry OPTIONAL

You must pass this parameter when sending messages at emergency priority. Set this value to the number of seconds before Pushover tries again to obtain confirmation of message receipt.

expire OPTIONAL

You must pass this parameter when sending messages at emergency priority. Set this value to the number of seconds before Pushover stops trying to obtain confirmation of message receipt.

url OPTIONAL

A string that will be attached to the message as a supplementary URL.

url_title OPTIONAL

A string that will be displayed as the title of any supplementary URL.

sound OPTIONAL

Select a sound to be associated with this notification. Check the Pushover API documentation for valid values.

push(%params)

push() is a DEPRECATED alias for message(). It will be removed in a future release, but remains for backwards compatibility.

user(%params)

user() sends an application token and a user token to Pushover and returns a scalar reference representation of the validity of those tokens. The following are valid parameters:

token REQUIRED

The Pushover application token, obtained by registering at http://pushover.net/apps.

user REQUIRED

The Pushover user token, obtained by registering at http://pushover.net.

device OPTIONAL

The Pushover device name; if not supplied, the message will go to all devices registered to the user token.

tokens(%params)

tokens() is a DEPRECATED alias for user(). It will be removed in a future release, but remains for backwards compatibility.

receipt(%params)

receipt() sends an application token and a receipt token to Pushover and returns a scalar reference representation of the confirmation status of the notification associated with the receipt. The following are valid parameters:

token REQUIRED

The Pushover application token, obtained by registering at http://pushover.net/apps.

receipt REQUIRED

The Pushover receipt token, obtained by parsing the output returned after sending a message with emergency priority.

DIAGNOSTICS

Inspect the value returned by any method, which will be a Perl data structure parsed from the JSON or XML response returned by the Pushover API.

DEPENDENCIES

DateTime
DateTime::Format::Strptime
Moo
Net::HTTP::Spore
Net::HTTP::Spore::Middleware::Header
Params::Validate
Readonly
URI

BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests to bug-webservice-pushover@rt.cpan.org, or through the web interface at http://rt.cpan.org.

AUTHOR

Steve Huff <shuff@cpan.org>

LICENCE AND COPYRIGHT

Copyright (c) 2012, Steve Huff <shuff@cpan.org>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.