Search the web
Sign In
New User? Sign Up
yws-shopping · Yahoo! Shopping Developer Support Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
The request failed   Message List  
Reply | Forward Message #221 of 242 |
Hello

I am getting this error <b>"The request failed"</b> my script works
fine with images,news,video and webs but not working for product
search. Please help me to solve this problem. My script is given below

$request
='http://api.shopping.yahoo.com/ShoppingService/v1/userproductreview?
catalogid=1991368668&appid=YahooDemo&results=5';
$response = file_get_contents($request);

if ($response === false) {
die('The request failed');
}
//echo htmlspecialchars($response, ENT_QUOTES);
// Create a new DOM object
$dom = new DOMDocument('1.0', 'UTF-8');

// Load the XML into the DOM
if ($dom->loadXML($response) === false)
{
die('Parsing failed');
}
$i = 0;
foreach ($dom->documentElement->childNodes as $articles)
{
//if node is an element (nodeType == 1) and the name is "item"
loop further
if ($articles->nodeType == 1 && $articles->nodeName == "Review")
{
foreach ($articles->childNodes as $n)
{
$subnodes = $articles->childNodes;

if($n->hasChildNodes())
{
foreach($n->childNodes as
$fcn)
{
if($fcn->hasChildNodes
())
{
foreach($fcn-
>childNodes as $second_n)
{
if
($second_n->hasChildNodes())
{

foreach($second_n->childNodes as $third_n)

{
$res[$i]
[$articles->nodeName][$n->nodeName][$fcn->nodeName][$second_n-
>nodeName]=trim($third_n->nodeValue);

}
}
else


$res
[$i][$articles->nodeName][$n->nodeName][$fcn->nodeName]=trim
($second_n->nodeValue);
}
}
else
$res[$i][$articles-
>nodeName][$n->nodeName]=trim($fcn->nodeValue);

}
}
else
$res[$i][$articles->nodeName]=trim($n-
>nodeValue);
$i++;
}
}
}
echo '<pre>';
print_r($res);
echo '</pre>';
?>

I uploaded this script at http://www.auctionsminer.com/yahoo.php

Server information is available at
http://www.auctionsminer.com/info.php





Wed May 2, 2007 9:36 am

pkumar125
Offline Offline
Send Email Send Email

Forward
Message #221 of 242 |
Expand Messages Author Sort by Date

Hello I am getting this error <b>"The request failed"</b> my script works fine with images,news,video and webs but not working for product search. Please help...
pkumar125
Offline Send Email
May 13, 2007
12:15 am

Hello I am getting this error "The request failed" while product search. My script is like this <?php error_reporting(E_ALL); // The web services request ...
pkumar125
Offline Send Email
May 13, 2007
12:15 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help