сделал таки:
Код: Выделить всё
<?php
#######################################
# @copyright (c) 2009 cathderay
#
# cathderay@gmail.com
#
#######################################
// The following code is required to properly run Xedant.com Human Emulator
require("../../Templates/xedant_human_emulator.php");
echo "çàïóñòèëèñü".date( 'H:i l d F', time())."<br>";
$browser->navigate("http://www.fakenamegenerator.com/mobile/gen-male-us-us.php");
$browser->wait(1);
// ïîëó÷àåì òåêñò
$fake_names= $webpage->get_body();
$fake_names = strip_tags($fake_names, '<h1><a><br><h2><h3>');
//write4Log_string("fake_names.html", $fake_names);
$browser->wait(240,1);
preg_match('%<H1>Your Identity</H1>(.*)<BR>(.*)<BR>(.*)<BR><BR>%siU', $fake_names, $fake_matches);
print_r($fake_matches);
/*
[1] => Lawrence C. Messina [2] => 3728 Whitetail Lane [3] => Dallas, TX 75201 )
*/
//write4Log_string("fake_matches.html", implode( ' ', $fake_matches));
$gen_firstname = substr(trim($fake_matches[1]), 0, strpos(trim($fake_matches[1]), " "));
$gen_lastname = substr(trim($fake_matches[1]), strrpos(trim($fake_matches[1]), " ")+1, strlen(trim($fake_matches[1])));
$rand_1 = rand(0,1);
$rand_2 = rand(0,1);
$rand_3 = rand(0,1);
$gen_login = ($rand_1 ? strtolower($gen_firstname) : strrev($gen_lastname)) . ($rand_2 ? rand(1961, 1992) : "") . ($rand_1 ? strtolower($gen_lastname) : strrev($gen_firstname)) . (!$rand_2 ? rand(1953, 1992) : "").(!$rand_3 ? substr(strtolower($gen_firstname), 2) : "");
$gen_password = genPassword().rand(0,9);
$browser->clear_cash();
$browser->clear_history();
$browser->clear_address_bar_history();
$browser->clear_cookies("");
$browser->enable_quiet_regime("false");
$browser->enable_java_script("false");
$needproxy=false;
// proxy & user agent
if ($needproxy)
{
$browser->set_default_authorization("login","pass");
$browser->enable_proxy("all connections","124.161.132.14:80");
}
$browser->navigate("https://edit.yahoo.com/registration?.intl=us&new=1&.done=http%3A//mail.yahoo.com&.src=ym&.v=0&.u=5mr0brp4ttvhh&partner=&.partner=&pkg=&stepid=&.p=&promo=&.last=");
$browser->wait_for(240,1);
$input->set_value_by_name('firstname',$gen_firstname);
$input->set_value_by_name('secondname',$gen_lastname);
$listbox->select_name_by_inner_name('mm','1');
$listbox->select_name_by_inner_name('country','us');
$input->set_value_by_name('dd','12');
$input->set_value_by_name('yyyy','1980');
$listbox->select_name_by_inner_name('gender','m');
$input->set_value_by_name('postalcode','06484');
$input->set_value_by_name('yahooid',$gen_login);
print_r("<br>");
print_r('yahooid: '.$gen_login."<br>");
$input->set_value_by_name('password',$gen_password);
$input->set_value_by_name('passwordconfirm',$gen_password);
print_r('password: '.$gen_password."<br>");
$listbox->select_name_by_inner_name('secquestion','What is the last name of your favorite musician?');
$input->set_value_by_name('secquestionanswer','secquestionanswer');
//$captcha = $app->dlg_captcha_from_image_number(6);
$captcha = $app->dlg_captcha_from_url_exactly("ab.login.yahoo.com","false");
print_r($captcha);
$browser->wait_for(240,1);
$input->set_value_by_name('cword',$captcha);
$browser->get_cookie();
$checkbox->click_by_name("tos_agreed");
$browser->wait_for(240,1);
//$mouse->click('269','506');
//$button->click_by_number(0);
// $webpage->click_on_element_by_inner_text("Create My Account");
$button->click_by_inner_text("Create My Account");
$browser->wait(1);
WaitSome();
$data=$webpage->get_source();
//$data = $webpage->get_body();
if(strpos($data, "Congratulations")) {
$geocities = signup_geocities($gen_login, $gen_password);
if($geocities) {
write4Log_string("acc.yahoo.com.txt", "\"".$gen_login."@yahoo.com\",\"".$gen_password."\",\"".$geocities."\"\n", "a");
}else {
write4Log_string("acc.yahoo.com.txt", "\"".$gen_login."@yahoo.com\",\"".$gen_password."\"\n", "a");
}
}else {
echo "Îáëîì!";
}
$browser->disable_proxy("all connections");
// Quit
$app->quit();
// ------------------------------------------------------func
function signup_geocities($gen_login, $gen_password) {
global $browser, $mouse, $input, $button, $app, $webpage, $radiobox, $checkbox;
$browser->clear_cash();
$browser->clear_history();
$browser->clear_address_bar_history();
$browser->clear_cookies("");
$browser->enable_quiet_regime("false");
$browser->enable_java_script("false");
$browser->navigate('http://geocities.yahoo.com/');
$browser->wait_for(240,1);
$browser->wait(1);
$input->set_value_by_name('login',$gen_login.'@yahoo.com');
$input->set_value_by_name('passwd',$gen_password);
$button->click_by_inner_text("Sign In");
//$browser->wait_for(240,1);
$browser->wait(3);
$browser->navigate('http://geocities.yahoo.com/reg');
$browser->wait(3);
$radiobox->click_by_name("q1");
$radiobox->click_by_number("0");
$checkbox->click_by_name("q2");
$checkbox->click_by_number("1");
$captcha = $app->dlg_captcha_from_url_exactly("ab.login.yahoo.com","false");
print_r($captcha);
$browser->wait_for(240,1);
$browser->wait(3);
$input->set_value_by_name('_secword',$captcha);
$button->click_by_inner_text("Submit");
$browser->wait_for(240,1);
$data = $webpage->get_body();
if(strpos($data, "Welcome to Yahoo! GeoCities")) {
return "http://www.geocities.com/".$gen_login;
}else {
echo "Îáëîì ñ geocities.yahoo.com!";
return false;
}
}
function WaitSome()
{
global $sleepsecond;
usleep(mt_rand($sleepsecond/4,$sleepsecond/2));
}
function write4Log_string($filename, $record, $type = "w"){
$logFile = fopen($filename,$type);
fwrite($logFile,$record);
fclose($logFile);
}
function genPassword() {
$chars = array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z", "a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","1","2","3","4","5","6","7","8","9","0");
$max_elements = count($chars) - 1;
$l = rand(8,13);
for ($i = 0; $i < $l; $i++) {
srand((double)microtime()*1000000);
$newpw .= $chars[rand(0,$max_elements)];
}
return $newpw;
}
?>