
Net::Stitcho - Client module for the Stitcho.com API

Version 0.01

use Net::Stitcho;
my $api = Net::Stitcho->new({
id => 1, # your partner id
key => '3246327a', # the secrect signing key
});
my $uri = $api->send_uri({
email => 'melo@cpan.org', # Recipient address
message => 'Yuppi!', # Message to send
url => 'http://stitcho.com/', # Jump to this URL on click
icon => 1, # ID of the icon to use
});
my $error = $api->send({
# same arguments as send_uri()
# this version uses LWP::UserAgent to actually call the API
});

The module provides access to the Stitcho.com notification service using the provided HTTP-based API.
You need to get an partner account at the site. After you have your API secret key, you can start to use this module.
You can use this module in two ways:
The first option is best if you have a way to do the HTTP GET request yourself. For example, if you are using AnyEvent or POE, you can use their Async HTTP client to call the API using the URI calculated by this module.

Creates a new API object. Accepts a hashref of parameters. Valid keys are:
Returns a API object.
Constructs the URI to use to send a notification to a user.
Accepts a hashref of parameters. Valid keys are:
Email address of recipient.
Title of the notification.
Message text.
If the message is clicked, the users browser will open with this URL.
Numeric ID of the icon to use.
Returns the complete URI to use to call the Send API. Use your prefered HTTP client to do the actual call.
Sends a notification to a user.
Accepts the same parameters as the send_uri() method.
After creating a proper URL, uses LWP::UserAgent to call the API.
If successful, returns no error (undef).
If not, returns the HTTP code of the operation. As of October 2008, the documented HTTP codes are:
The call was formatted correctly, but the user was not connected, so the notiï¬cation was not sent.
The request was incorrectly formatted.
If you get this error code, report it as a bug to the author of this module.
The signature was invalid. Check the id and key parameters to your call to new().
An unanticipated error occurred, and the problem most likely lies with Stitcho, not your software. Retry in a minute or so.
Constructs the URI to use to send the signup email message to a email address.
Accepts a hashref of parameters. Valid keys are:
Returns the complete URI to use to call the Signup API. Use your prefered HTTP client to do the actual call.
Sends a signup email to a email address.
Accepts the same parameters as the signup_uri() method.
After creating a proper URL, uses LWP::UserAgent to call the API.
See the send() method for possible return codes.

This module does not export any symbols.

Pedro Melo, <melo at cpan.org>

Please report any bugs or feature requests to bug-net-stitcho at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Stitcho. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

You can find documentation for this module with the perldoc command.
perldoc Net::Stitcho
You can also look for information at:

Copyright 2008 Pedro Melo.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.