PHP cкрипт в Хуман Эмуляторе

Статус
В этой теме нельзя размещать новые ответы.

Свой

Создатель
Регистрация
22 Апр 2009
Сообщения
17
Реакции
0
Вообщем надыбал скриптик для регистрации co.cc.
Не совсем актуальный правда, но...
Вообщем не получается прикрутить антикапчу, хоть делаю все как написано у автора.
Собственно скрипт:
Код:
<?php
// The following code is required to properly run Xedant.com Human Emulator
require("../Templates/xweb_human_emulator.php");
//$browser->disable_proxy("all connections");
//$browser->enable_proxy("all connections","127.0.0.1:8118");
include "anticaptcha2.php";
$string = "qwertyuiopasdfghjklzxcvbnm";
function step_1 ($browser, $anchor, $input, $listbox, $app, $checked, $button, $image, $checkbox, $string, $webpage){
for ($md=0;$md<7;$md++)
{
$rand_bukvaname .= substr($string,rand(0,25),1);
$rand_bukvafamily .= substr($string,rand(0,25),1);
$rand_mail .= substr($string,rand(0,25),1);
$rand_state1 .= substr($string,rand(0,25),1);
$rand_state2 .= substr($string,rand(0,25),1);
$rand_state3 .= substr($string,rand(0,25),1);
}
$randday = rand(11,31);
$randmes = rand(1,12);
$randyear = rand(1970,1985);
$rand_phone1 = rand(10000,30000);
$rand_phone2 = rand(10000,30000);
$rand_phone3 = rand(10000,30000);
$rand_phone = $rand_phone1.$rand_phone2.$rand_phone3;
$browser->navigate("http://www.co.cc/ ");
$browser->wait(2);
$anchor->click_by_inner_text("Создайте аккаунт прямо сейчас","true");
$browser->wait(2);
$input->set_value_by_name("first_name",$rand_bukvaname);
$input->set_value_by_name("last_name",$rand_bukvafamily);
$input->set_value_by_name("email", $rand_mail."@yahoo.com");
$listbox->select_name_by_inner_name("sex","w");
$listbox->select_name_by_inner_name("birth_d", $randday);
$listbox->select_name_by_inner_name("birth_m", $randmes);
$listbox->select_name_by_inner_name("birth_y", $randyear);
$input->set_value_by_name("pw","123456");
$input->set_value_by_name("pw_re","123456");
/*
$captcha = $app->dlg_captcha_from_image_number(11);
$input->set_value_by_name("image_pw",$captcha);
*/
$image->save_to_file_by_url("word_verification/word_verification.php","c:\captcha.jpg","false");
$Captcha=recognize("c:\captcha.jpg","мой код антикапчи",true);
//if($Captha==false){$app->quit();}else
echo $Captcha;
$input->set_value_by_name("image_pw",$Captcha);
//$input->set_value_by_name("","GR7NGN");
$input->set_value_by_name("account_info[address]", $rand_state1);
$input->set_value_by_name("account_info[city]",$rand_state2);
$input->set_value_by_name("account_info[state]", $rand_state3);
$listbox->select_name_by_inner_name("account_info[country]","BH");
$input->set_value_by_name("account_info[phone]", $rand_phone);
// get check state
$checked = $checkbox->is_checked_by_name("regist_agreement");
if ($checked=="true")
$checkbox->set_checked_by_name("regist_agreement","false");
else
$checkbox->set_checked_by_name("regist_agreement","true");
$button->click_by_name("button");
$browser->wait(2);
}
function vcikle ($browser, $anchor, $input, $listbox, $app, $checked, $button, $image, $checkbox, $string, $webpage){
step_1($browser, $anchor, $input, $listbox, $app, $checked, $button, $image, $checkbox, $string, $webpage);
//----ПРОВЕРЯЕМ ЧТО КАПТЧА ПРАВИЛЬНО ВВЕЛАСЬ
preg_match_all('/(The characters you entered did not match it)/', $webpage->get_body(), $result, PREG_PATTERN_ORDER);
$yandex_uspeh = $result[1][0];
if ($yandex_uspeh !=null)
{
step_1($browser, $anchor, $input, $listbox, $app, $checked, $button, $image, $checkbox, $string, $webpage);
}
//------ПОЛУЧЕНИЕ НОВОГО ДОМЕНА-----------
for ($i=1;$i<5;$i++){
//Получение нового домена
$anchor->click_by_number(8);
$browser->wait(2);
//----------------------------------------
$rand_bukva = "";
for ($md=0;$md<8;$md++)
{
$rand_bukva .= substr($string,rand(0,25),1);
}
$open=fopen("c:\otchet.txt","a");
fwrite($open, $rand_bukva.".co.cc \n");
fclose($open);
//-------Name domains enter
$input->set_value_by_name("domain",$rand_bukva);
$button->click_by_name("button");
$browser->wait(2);
//------------
$button->click_by_name("button");
$browser->wait(2);
$button->click_by_name("button");
$browser->wait(2);
//-Vipolnite nastrojku END STEP
$button->click_by_name("button");
$browser->wait(2);
//-------------
$browser->navigate("javascript:direct_edit_my_domain('dns','');");
$browser->wait(20);
$input->set_value_by_name("ns_host[0]","ns1.s27.org.ua");
$input->set_value_by_name("ns_host[1]","ns2.s27.org.ua");
$button->click_by_number("0");
$browser->wait(2);
//You change has been submitted
$anchor->click_by_number(1);
$browser->wait(2);
}
$anchor->click_by_number(3);
}
for ($kolichestvo=0;$kolichestvo<1000;$kolichestvo++)
{
vcikle ($browser, $anchor, $input, $listbox, $app, $checked, $button, $image, $checkbox, $string, $webpage);
}
// Quit
$app->quit();
?>
В отладчике выдает:
Fatal error: Cannot redeclare recognize() (previously declared in C:\Program Files\XWeb\Human Emulator5\My Scripts\anticaptcha.php:29) in C:\Program Files\XWeb\Human Emulator5\My Scripts\anticaptcha2.php on line 102
В этом деле нуб-нубом, но оч. хочу разобраться. мучаюсь битый час.
Собственно строчки 29 и ниже:
Код:
function recognize($filename, $apikey, $is_verbose = true, $rtimeout = 5, $mtimeout = 120, $is_phrase = 0, $is_regsense = 0, $is_numeric = 0, $min_len = 0, $max_len = 0)
{
	if (!file_exists($filename))
	{
		if ($is_verbose) echo "file $filename not found\n";
		return false;
	}
    $postdata = array(
        'method'    => 'post',
        'key'       => $apikey,
        'file'      => '@'.$filename, //полный путь к файлу
        'phrase'	=> $is_phrase,
        'regsense'	=> $is_regsense,
        'numeric'	=> $is_numeric,
        'min_len'	=> $min_len,
        'max_len'	=> $max_len,
 
функция recognize уже есть, поэтому ругается...

закоментируй в коде эту строчку include "anticaptcha2.php";
 
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху