HI Dave,
How are you making out with the shopzilla.com api? I have attempted it but there seems to be some issues on shopzilla's end.
One issue I noticed is the way the shopzilla api responds when there are no results for the submitted keyword.
For example, if you run the shopzilla.com api with a very popular keyword like "xbox" The results are displayed immediately, but if you search a less popular keyword like "Richfield Grande Collector Plate Frame" there is major lag and the page does not load.
In addition,
no results require a Magic Parser Format String of xml|PRODUCTRESPONSE/
and
results found require a Magic Parser Format String of xml|PRODUCTRESPONSE/OFFERS/OFFER/
How on earth is it possible to parse the shopzilla.com api with just one Magic Parser Format String if it is different for no results found and results found?
Hi David
I would be very interested in this for my site. I have to use shopzilla. So if you work out a script I love to use it.
Thank You
Dean
Hi Dean,
Will follow up by email...
Cheers,
David.
Hi david
I am also interested in the script for the Shopzilla API
Thank you for your reply
Hi Syn,
Welcome to the forum! I'll follow up by email for you...
Cheers,
David.
--
PriceTapestry.com
Thanks David,
But they dont work with the french API of Shopzilla, i have remplace the api url "http://catalog.bizrate.com/services/catalog/v1/us/product?apiKey=" to "http://catalog.shopzilla.fr/services/catalog/v1/api/product/4?apiKey=" but its doesn't work no result with this one
and with the first url no probleme :/
Hi Syn,
If you could reply to my email with your modified version showing the URL that you need to use, and I'll check the response - it may need to be modified slightly...
Cheers,
David.
--
PriceTapestry.com
Hi harican,
It should only be necessary to use one Format String (the one for a response containing records) - the "no response" result can simply be ignore; otherwise if you would like to display a caption, e.g. "Shopzilla Results" on your site; the neatest solution is to actually parse the results into an array; and then after the call to MagicParser_parse(), count() the array, and if there are results, display your caption, and then foreach() through the array to display each one. Consider the following example to show the idea in principle...
<?php
$records = array();
function myRecordHandler($record)
{
global $records;
$records[] = $record;
}
$url = "http://www.example.com/api.asp?q=".urlencode($q);
MagicParser_parse($url,"myRecordHandler","xml|PRODUCTRESPONSE/OFFERS/OFFER/");
function myDisplayRecordHandler($record)
{
// original myRecordHandler function to display results
}
if (count($records))
{
print "<h2>Example.com Results</h2>";
foreach($records as $record)
{
myRecordHandler($record);
}
}
?>
If you're not sure of course, email me your API script so far and I'll check it out for you...
Hope this helps!
Cheers,
David.