|
|
|
| все не могу больше:)) народ у кого есть рабочий пример скрипта, работающего с yandex.xml? поделитесь - я уже голову себе сломал пытаясь разобраться с этим... | |
|
|
|
|
|
|
|
для: mirror
(09.08.2006 в 12:07)
| | вот что написал сам:
<?
$xml = "<?xml version=\"1.0\" encoding=\"windows-1251\"?>
<request>
<query>test</query>
<groupings>
<groupby attr=\"d\" mode=\"deep\" groups-on-page=\"10\" docs-in-group=\"1\" />
</groupings>
</request>";
$url = "http://xmlsearch.yandex.ru/xmlsearch/";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_USERPWD, "пароль");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$xml);
$result=curl_exec($ch);
print_r(curl_getinfo($ch));
echo "\n\ncURL error number:" .curl_errno($ch);
echo "\n\ncURL error:" . curl_error($ch);
curl_close($ch);
?>
|
но в ответ получаю: "502 Bad Gateway"
в чем здесь может быть проблема? | |
|
|
|
|
|
|
|
для: mirror
(09.08.2006 в 15:58)
| | Откуда ту вооще пароль появился? | |
|
|
|