WebService::Prowl - a interface to Prowl Public API
use WebService::Prowl;
WebService::Prowl is a interface to Prowl Public API
This module aims to be a implementation of a interface to the Prowl Public API (as available on http://www.prowlapp.com/api.php
use WebService::Prowl; my $ws = WebService::Prowl->new(apikey => 40byteshexadecimalstring); $ws->verify || die $ws->error(); $ws->add(application => "Favotter App", event => "new fav", description => "your tweet saved as sekimura's favorite", url => "https://github.com/sekimura")) { }
Call new() to create a Prowl Public API client object. You must pass the apikey, which you can generate on "settings" page https://www.prowlapp.com/settings.php
my $apikey = 'cf09b20df08453f3d5ec113be3b4999820341dd2'; my $ws = WebService::Prowl->new(apikey => $apikey);
If you have been whitelisted, you may want to use 'providerkey' like this:
my $apikey = 'cf09b20df08453f3d5ec113be3b4999820341dd2'; my $providerkey = '68b329da9893e34099c7d8ad5cb9c94010200121'; my $ws = WebService::Prowl->new(apikey => $apikey, providerkey => $providerkey);
Sends a verify request to check if apikey is valid or not. return 1 for success.
$ws->verify();
Sends a app request to api and return 1 for success.
application: [256] (required) The name of your application event: [1024] (required) The name of the event description: [10000] (required) A description for the event url: [512] Optional *Requires Prowl 1.2* The URL which should be attached to the notification. priority: An integer value ranging [-2, 2] a priority of the notification: Very Low, Moderate, Normal, High, Emergency default is 0 (Normal) $ws->add(application => "Favotter App", event => "new fav", description => "your tweet saved as sekimura's favorite");
Get a registration token for use in retrieve/apikey and the associated URL for the user to approve the request. See example/retrieve to learn how to use retrieve_token() and retrieve_apikey()
success return value looks like this:
$VAR1 = { 'success' => { 'remaining' => '999', 'resetdate' => '1296803193', 'code' => '0' }, 'retrieve' => { 'url' => 'https://www.prowlapp.com/retrieve.php?token=fe645f043ce20f7f179c909df062334c14c51a8b', 'token' => 'fe645f043ce20f7f179c909df062334c14c51a8b' } };
Get an API key from a registration token retrieved in retrieve/token. The user must have approved your request first, or you will get an error response. See example/retrieve to learn how to use retrieve_token() and retrieve_apikey()
$VAR1 = { 'success' => { 'remaining' => '999', 'resetdate' => '1296803193', 'code' => '200' }, 'retrieve' => { 'apikey' => 'd17e9cfffcb0a0c3091beda69cc31b6134c875c8' } };
Returns any error messages as a string.
$ws->verify() || die $ws->error();
Masayoshi Sekimura <sekimura@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
http://www.prowlapp.com/, http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=320876271
To install WebService::Prowl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Prowl
CPAN shell
perl -MCPAN -e shell install WebService::Prowl
For more information on module installation, please visit the detailed CPAN module installation guide.