AnyEvent-WebService-ImKayac

 view release on metacpan or  search on metacpan

lib/AnyEvent/WebService/ImKayac.pm  view on Meta::CPAN

package AnyEvent::WebService::ImKayac;

use strict;
use warnings;

our $VERSION = '0.01';
our $URL = "http://im.kayac.com";

use AnyEvent::HTTP;
use HTTP::Request::Common;
use Digest::SHA qw/sha1_hex/;
use JSON;
use Carp;

=head1 NAME

AnyEvent::WebService::ImKayac - connection wrapper for im.kayac.com

=head1 SYNOPSIS

  use AnyEvent::WebService::ImKayac;

  my $im = AnyEvent::WebService::ImKayac->new(
    type     => 'password',
    user     => '...',
    password => '...'
  );

  $im->send( message => 'Hello! test send!!', cb => sub {
      my ($hdr, $json, $reason) = @_;

      if ( $json ) {
          if ( $json->{result} eq "posted" ) {
          }
          else {
              warn $json->{error};
          }
      }
      else {
          warn $reason;
      }
  });

=head2 METHODS

=head3 new

You must pass C<< type >> and C<< user >> parameter to new method. And type should be
secret, password or none.

=over 3

=item type is secret

You should pass secret_key parameter.

=item type is password

You should pass password parameter.

=item type is none

You dond need to pass other parameter.

=back

=cut

sub new {
    my $pkg = shift;



( run in 1.283 second using v1.01-cache-2.11-cpan-97f6503c9c8 )