NAME
WWW::Omegle - Perl interface www.omegle.com
SYNOPSIS
use WWW::Omegle;
my $ombot = WWW::Omegle->new(
on_connect => \&connect_cb,
on_chat => \&chat_cb,
on_disconnect => \&disconnect_cb,
);
$ombot->start;
while ($ombot->get_next_event) { 1; }
exit;
sub connect_cb {
my ($om) = @_;
print "Connected\n";
$om->say('u sux');
}
sub chat_cb {
my ($om, $what) = @_;
print ">> $what\n";
}
sub disconnect_cb {
my ($om) = @_;
print "Disconnected.\n";
}
DESCRIPTION
This is a perl interface to the backend API for www.omegle.com. This module lets you easily script chating with random, anonymous people around the world. Note that this uses an unofficial API and is subject to breakage if the site author chooses to change their interface.
EXPORT
None by default.
METHODS
- new(%opts)
-
Construct a new Omeglebot. Supported options are on_chat, on_disconnect and on_connect, which must be coderefs. See synopsis for usage examples. Other %opts are passed to the WWW::Mechanize constructor
- start
-
Begins a chat with a random stranger. Returns success/failure.
- say($message)
-
Says something to your chat buddy. Returns success/failure
- disconnect
-
Terminates your conversation.
- get_next_event
-
Fetches the next event and dispatches to the appropriate callback. See synopsis.
SEE ALSO
WWW::Mechanize
AUTHOR
Mischa Spiegelmock, <revmischa@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2009 by Mischa Spiegelmock
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.