package WWW::Omegle;
use 5.006000;
use strict;
use warnings;
use Carp qw/croak/;
use JSON;
use base qw/WWW::Mechanize/;
use HTTP::Async;
use HTTP::Request;
use HTTP::Request::Common;
our $VERSION
ra;
$self->{om_callbacks}->{$action} = $cb;
}
# process a HTTP::Response from /events. parse JSON and dispatch to callbacks
sub handle_event {
my ($self, $res) = @_;
unless ($res->is_suc
# not JSON array of events
$self->callback(error => "Got invalid JSON: " . $res->content);
return;
}
}
my $json = new JSON;
my $events = $json->decod