WebService::ImKayac::Simple - Simple message sender for im.kayac
use WebService::ImKayac::Simple; my $im = WebService::ImKayac::Simple->new( type => 'password', user => '__USER_NAME__', password => '__PASSWORD__', ); $im->send('Hello!'); $im->send('Hello!', 'mailto:example@example.com'); # you can append handler to the message
WebService::ImKayac::Simple is the simple message sender for im.kayac (http://im.kayac.com/).
WebService::ImKayac::Simple->new()
Constructor. You can specify user, password and type through this method.
user
password
type
Essential arguments are changed according to the type. type allows only "password", "secret" or empty. Please refer to the following for details of each type.
With no authentication:
my $im = WebService::ImKayac::Simple->new( user => '__USER_NAME__', );
With password authentication:
my $im = WebService::ImKayac::Simple->new( type => 'password', user => '__USER_NAME__', password => '__PASSWORD__', );
With secret key authentication:
my $im = WebService::ImKayac::Simple->new( type => 'secret', user => '__USER_NAME__', password => '__SECRET_KEY__', );
Also you can configure by YAML file:
my $im = WebService::ImKayac::Simple->new('path/to/config.yml');
Sample of YAML config file:
user: foo password: bar type: __TYPE__
$im->send($message, $handler)
Send message.
$message is required. It must be utf-8 string or perl string.
$message
$handler is optional. Please refer http://im.kayac.com/#docs if you want to get details.
$handler
Tests which are calling web API directly in xt/webapi. If you want to run these tests, please execute like so;
$ IM_KAYAC_NONE_USER=__USER_NAME__ prove xt/webapi/00_none.t
AnyEvent::WebService::ImKayac
Copyright (C) moznion.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
moznion <moznion@gmail.com>
To install WebService::ImKayac::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::ImKayac::Simple
CPAN shell
perl -MCPAN -e shell install WebService::ImKayac::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.