
Untitled
By: a guest on
Jun 30th, 2012 | syntax:
None | size: 0.95 KB | hits: 48 | expires: Never
#!/usr/bin/perl -w
use AntiCaptcha;
use WWW::Mechanize::Firefox;
my $mech = WWW::Mechanize::Firefox->new();
$mech->get('http://0chan.ru/b/res/10638550.html');
$mech->eval('$("#captchaimage").attr("src", "http://0chan.ru/captcha.php?" + Math.random()); $("#captcha_status").html(""); captcha_shown = 1');
$mech->eval('$("#postform").attr("action", "http://0chan.ru/board.php?dir=b")');
$image = $mech->xpath('//img[@id="captchaimage"]', one => 1);
while(length($mech->element_as_png($image)) < 100)
{
sleep(3);
}
#print $mech->element_as_png($image);
my $ac = AntiCaptcha->new('antigate.com', '>>>REPLACE THIS<<<'); die "Y U NO READ SOURCE?!";
my $id = $ac->Recognize($mech->element_as_png($image));
until($captcha = $ac->GetStatus($id))
{
sleep(5);
}
print $captcha;
$mech->form_id('postform');
$mech->set_fields(
captcha => $captcha,
message => 'test',
);
$mech->click({ xpath => '//input[@type="submit"]', one => 1 });
sleep(120);