Permalink
Browse files

3.6: added on_badcaptcha callback, called when a submitted captcha is…

… incorrect
  • Loading branch information...
1 parent 60f3767 commit 22cac8d8cba5ea8782761a0f46b3bfc36d01dc54 @cooper committed Apr 14, 2012
Showing with 9 additions and 1 deletion.
  1. +7 −1 New/Omegle.pm
  2. +2 −0 README.md
View
@@ -26,7 +26,7 @@ use Furl;
use JSON;
our ($VERSION, $online, $ua, @servers,
- $updated, $lastserver, %response) = (3.5, 0, Furl->new);
+ $updated, $lastserver, %response) = (3.6, 0, Furl->new);
# New::Omegle->new(%opts)
# creates a new New::Omegle session instance.
@@ -288,6 +288,12 @@ sub handle_event {
$om->done();
}
+ # captcha was rejected
+ when ('recaptchaRejected') {
+ $om->fire('badcaptcha');
+ continue;
+ }
+
# server requests captcha
when (['recaptchaRequired', 'recaptchaRejected']) {
$om->fire('wantcaptcha');
View
@@ -41,6 +41,7 @@ be changed dynamically by changing the associated values.
- __on_spychat__ (stranger, message): callback called when a spyee sends a message
- __on_wantcaptcha__: callback called when human verification is required
- __on_gotcaptcha__ (image URL): callback called when captcha URL is resolved
+- __on_badcaptcha__: callback called when a submitted captcha is incorrect
- __use_likes__: true if you wish to look for strangers similar to you
- __use_question__: true if you wish to enable spy mode and ask a question
- __want_question__: true if you wish to enable spy mode and be asked a question
@@ -65,6 +66,7 @@ my $om = New::Omegle->new(
on_spychat => \&spychat_cb,
on_wantcaptcha => \&gotcaptcha_cb,
on_gotcaptcha => \&gotcaptcha_cb,
+ on_badcaptcha => \&badcaptcha_cb,
server => 'bajor.omegle.com', # don't use this option without reason
topics => ['IRC', 'Omegle', 'ponies'],
use_likes => 1,

0 comments on commit 22cac8d

Please sign in to comment.