Написал скрипт автоматического addurl в yandex.
good.txt - файл с удачным addurl
bad.txt - файл с не удачным addurl
urls.txt - файл с урл
proxy.txt - файл с прокси,если потребуется работа через прокси
Удобно ставить на крон,можно указать задержку между добавлением ссылок.
Скачать
< ?php /** * @author RushteR * @copyright 2009 */ set_time_limit(0); include ("func.php"); $good = fopen("good.txt", "at"); // good file $bad = fopen("bad.txt", "at"); // bad file //$proxy = file("proxy.txt"); // uncomment if you need a proxy $urls = file("urls.txt"); // url file $ackey = ""; // ac-service.info key $patch = 'C://wamp/www/yaddr\\'; // full path to the folder (if windows) $sleep = 0; // delay time function savecap($url, $name = "savecap", $type = "jpg", $cook = "") { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); if (isset($proxy)) curl_setopt($ch, CURLOPT_PROXY, $proxy[rand(0, count($proxy) - 1)]); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_COOKIE, $cook); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.7)'); $result = curl_exec($ch); $fp = fopen($name . "." . $type, 'w'); fwrite($fp, $result); fclose($fp); } $ch = curl_init(); foreach ($urls as $url) { curl_setopt($ch, CURLOPT_URL, 'http://webmaster.yandex.ru/addurl.xml'); curl_setopt($ch, CURLOPT_POST, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); if (isset($proxy)) curl_setopt($ch, CURLOPT_PROXY, $proxy[rand(0, count($proxy) - 1)]); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_AUTOREFERER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.7)'); $resp = curl_exec($ch); preg_match('#name="key" type="hidden" value="(.*?)">#', $resp, $out); preg_match_all('#^Set-Cookie: ([^;]*)#mi', $resp, $cookies); $cook = implode('; ', $cookies[1]); savecap("http://captcha.yandex.net/image?key=$out[1]", "savecap", "jpg", $cook); $code = recognize($patch . "savecap.jpg", $ackey, 0); curl_setopt($ch, CURLOPT_URL, "http://webmaster.yandex.ru/addurl.xml"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); if (isset($proxy)) curl_setopt($ch, CURLOPT_PROXY, $proxy[rand(0, count($proxy) - 1)]); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_COOKIE, $cook); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.7)'); curl_setopt($ch, CURLOPT_POSTFIELDS, "url=$url&key=$out[1]&rep=$code&do=add"); $responce = curl_exec($ch); if (strstr($responce, "302")) { echo $url . " OK<br />"; fwrite($good, "$url - Ok\n"); flush(); ob_flush(); } else { echo $url . " BAD<br />"; fwrite($bad, "$url - BAD\n"); flush(); ob_flush(); } unset($urls[0]); file_put_contents("urls.txt", $urls); sleep($sleep); } ?>