NAME

Captcha::Nocaptcha - Module for working with Nocaptcha Mail.Ru service

SYNOPSIS

use Captcha::Nocaptcha;

use constant PUBLIC_KEY => 'e5238532bf56e4c24bd5489d463ac2a0';
use constant PRIVATE_KEY => '3cf11185476394b85bcec3fbf16c69a4';

my $script = nocaptcha_generate_captcha_tag(PUBLIC_KEY);

if (nocaptcha_check(PRIVATE_KEY, $form_params->{captcha_id}, $form_params->{captcha_value})) {
    print('OK');
}
else {
    print('ERROR');
}

DESCRIPTION

Nocaptcha is an intelligent CAPTCHA service that can deliver a majority of real users from solving a CAPTCHA riddle with the same protection level from spam scripts. The service has been successfully used in our internal projects and on sites unrelated to Mail.Ru.

This module is Perl implementation of Nocaptcha Mail.Ru service API.

Use this email for feedback: nocaptcha@corp.mail.ru

EXPORT

nocaptcha_generate_captcha_url

Same as Captcha::Nocaptcha::generate_captcha_url.

nocaptcha_generate_captcha_tag

Same as Captcha::Nocaptcha::generate_captcha_tag.

nocaptcha_check

Same as Captcha::Nocaptcha::check.

nocaptcha_check_detailed

Same as Captcha::Nocaptcha::check_detailed.

METHODS

generate_captcha_url

Generate URL for Nocaptcha script. It should be placed in the page header. Take public key as parameter.

generate_captcha_tag

Generate HTML tag for Nocaptcha script. It should be placed in the page header. Take public key as parameter.

check

Check CAPTCHA value received from user. Parameters: private key, CAPTCHA ID, CAPTCHA value. Return 1 if value is correct or 0 in other case.

check_detailed

Check CAPTCHA value received from user. Parameters: private key, CAPTCHA ID, CAPTCHA value. Return reference to hash with keys: is_ok, is_correct, error. If error occur is_ok=0 and error contains error message. In other case is_ok=1 and is_correct contains result of check.

SEE ALSO

AUTHOR

Oleg Kovalev, <man0xff@gmail.com>

COPYRIGHT AND LICENSE

CC0

To the extent possible under law, Mail.Ru has waived all copyright and related or neighboring rights to Perl module for working with Nocaptcha Mail.Ru service. This work is published from: Russian Federation.