Завтра насчитают лимиты. Нашел готовый скрипт, скажите он будет работать?
$postdata = '<?xml version="1.0" encoding="UTF-8"?><request><query>Блог сеошника</query><sortby></sortby><maxpassages>1</maxpassages><page&g t;0</page><groupings><groupby attr="d" mode="deep" groups-on-page="10" docs-in-group="3" /></groupings></request>';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://xmlsearch.yandex.ru/xmlsearch?user=&key=");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_ENCODING, "");
$data = curl_exec($ch);
curl_close($ch);
$pos = 0;
$xml = simplexml_load_string($data);
foreach ($xml as $urldata)
{
$pos++;
$name = $urldata->doc->url;
$poss = strripos($name, 'gloys.ru');
if ($poss > 0) {
echo 'Позиция: '.$pos;
break;
}
}
_____________
Womans in your town