AnyEvent-Lingr

 view release on metacpan or  search on metacpan

inc/Module/Install/CPANfile.pm  view on Meta::CPAN

        $write_all->(@_);
        $self->merge_meta_with_cpanfile;
    };

    $self->include("Module::CPANfile");
    $self->configure_requires("CPAN::Meta");

    if ($self->is_admin) {
        if (eval { require CPAN::Meta::Check; 1 }) {
            my $prereqs = Module::CPANfile->load->prereqs;
            my @err = CPAN::Meta::Check::verify_dependencies($prereqs, [qw/runtime build test develop/], 'requires');
            for (@err) {
                warn "Warning: $_\n";
            }
        } else {
            warn "CPAN::Meta::Check is not installed. Skipping dependencies check for the author.\n";
        }
    }
}

1;

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

}

sub start_session {
    my ($self) = @_;

    debugf "starting session...";

    if ($self->session) {
        debugf "found old session:%s reusing...", $self->session;

        $self->get('session/verify', { session => $self->session }, sub {
            my ($res, $hdr) = @_;
            return unless $self;

            if ($res and $res->{status} eq 'ok') {
                infof "session verified: %s", $res->{session};
                $self->_get_channels;
            }
            else {
                debugf "session verify failed: %s", ddf($res || $hdr);
                $self->session(undef);
                $self->_on_error($res, $hdr);
            }
        });
    }
    else {
        debugf "create new session...";

        $self->post('session/create', {
            user     => $self->user,

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

=item * password => 'Str' (required)

Lingr password

=item * api_key => 'Str' (optional)

Lingr api_key.

=item * session => 'Str' (optional)

Lingr session key. If this parameter is passed, this module try to reuse this key for calling session/verify api, otherwise create new session.

=back

    my $lingr = AnyEvent::Lingr->new(
        user     => 'your lingr username',
        password => 'your lingr password',
        api_key  => 'your lingr api_key', # optional
    );

=head2 start_session

Start lingr chat session.

This method runs following sequences:

=over

=item 1. Create session (or verify session if session parameter was passed)

=item 2. Get joined room list, and then fire C<on_room_info> callback.

=item 3. Subscribe all joined room events, and wait events...

=item 4. When some events is occurred, fire C<on_event> callback

=item 5. goto step 3.

=back



( run in 0.415 second using v1.01-cache-2.11-cpan-5467b0d2c73 )