Decaptcha-TextCaptcha

 view release on metacpan or  search on metacpan

ex/live-test.pl  view on Meta::CPAN

    agent   => 'Mozilla 5.0',
    timeout => 15,
);
$ua->codes_to_determinate()->{404} = 1;
$ua->timing('2,5,10');

my $url = "http://api.textcaptcha.com/$key";
while (1) {
    my $res = $ua->get($url);
    next unless $res->is_success;
    my $content = $res->decoded_content;

    my ($q) = $content =~ m[<question>(.*?)</question>];
    decode_entities($q);
    my $a = decaptcha($q) // '';
    my $md5 = md5_hex $a;

    my @a = $content =~ m[<answer>(.*?)</answer>]g;
    my $ok = grep { $md5 eq $_ } @a;

    say $q, ' : ', $a, ' : ', $ok ? 'ok' : 'NOK';



( run in 0.240 second using v1.01-cache-2.11-cpan-26ccb49234f )