AnyEvent-Lingr

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

Revision history for Perl extension AnyEvent::Lingr

0.07 2013-03-21T11:42:00+09:00
     - fixed observe event error message was undef on http level error.

0.06 2013-03-19T11:41:00+09:00
     - added one more missing prereq: URI

0.05 2013-03-18T16:09:00+09:00
     - fixed a bug that 'cb' parameter of say method should be optional, but not in 0.04

0.04 2013-03-18T09:14:00+09:00
     - added a missing prereq.

0.03 2013-03-18T09:09:00+09:00
     - added a callback for say method for getting API response. (xaicron)
     - fixed some debug messages

0.02 2013-03-15T11:45:00+09:00
     - change observe event timeout 300 to 60
     - fixed observe event error message was undef on http level error.

0.01 2013-03-14T18:50:00+09:00
     - initial version

lib/AnyEvent/Lingr.pm  view on Meta::CPAN

        }
        else {
            $self->_on_error($res, $hdr);
        }
    };
    Scalar::Util::weaken($self);

    $self->_polling_guard( $guard );
}

sub say {
    my ($self, $room, $msg, $cb) = @_;

    $self->post('room/say', { session => $self->session, room => $room, text => $msg }, sub {
        my ($res, $hdr) = @_;
        return unless $self;

        if ($res and $res->{status} eq 'ok') {
            $cb->($res) if $cb;
        }
        else {

lib/AnyEvent/Lingr.pm  view on Meta::CPAN


For updating subscription list, you can use C<update_room_info> method:

    $lingr->update_room_info;

=head2 update_room_info

Update joined room info, and fire on_room_info callback.
This method also update subscription rooms which is target room for on_event callback.

=head2 say($room, $message [, $cb ])

Say something to lingr room.

    $lingr->say('perl_jp', 'hi!');

If you want response data, you can speficy callback.
The callback is invoked when the API call was successful.

    $lingr->say('perl_jp', 'hi there!', sub {
        my $res = shift;
        warn $res->{message}->{id};
    });

=head1 CALLBACKS

This module supports following three callbacks:

=over



( run in 1.342 second using v1.01-cache-2.11-cpan-483215c6ad5 )