Hi,
As you will be aware Awin have launched their new ShopWindow software, which is fine in so far as it goes.
It is possible to access the API using SOAP the API WSDL is here:
http://api.productserve.com/v1/ProductServeService?wsdl
I have typed the above, and can understand the words individially, but haven't a clue what it all means. (Yep, I still am php-ally challenged).
What I would like to be able to do is to download feeds, (as I am currently doing using one of the original download scripts), but for example all MP3 players - I understand that I would probably have to construct some sort of url to GET, but what to put in it remains a bit of a mystery.
E.g. http://api.productserve.com? I would need to pass
1. Awin Username
2. Password
3. What I am doing (i.e. downloadproducts)
4. Which category of products
5. From which merchants (i.e. all subscribed)
6. What info about these products (i.e. name, description, url, image, category, brand)
If someone could please give me some idea how to start going about this, I would be massively grateful.
Thanks in advance!
Duncan
Hi David,
That would certainly be fairly useful from a price comparison point of view, however I am using a fairly botched version of PT on one site that exclusively uses the Tradedoubler "category" feeds (i.e. exactly what I am trying to do with the Awin feeds) - I would like to be able to add Awin to this. This would also mean that we are not at the behest of the Awin servers.
Having said that, the ability to add x category from x merchant would also be useful for other sites, particularly for the likes of catalogue shops that have products in many categories - the only network that currently offers a decent solution to this is Buy.at
Cheers,
Duncan
Just as an update, I botched together a script that would display the requested data as a pipe-separated csv, however the Awin API will only return 100 products per SOAP request. (With additional products being via another request etc.)
As (for example) the Childrenswear category has 5,000 products, this would then involve 50 requests, and cobbling large chunks together, which is impractical.
The good news is that Awin are releasing some more advanced feeds, "soon".
Further to this, I have integrated the Awin software at http://www.shopwindow.me.am , and it all appears to be running okay.
My next brainwave was to try and knock together sitemaps for each of the categories - limited to 100 products each, but showing the most popular products.
Unfortnately Awin use Smarty templating, and as such the content and style is all over the place, however I have managed to create a page that will output a list of urls as such:
http://www.shopwindow.me.am/feed2.php?iListLimit=100&sListSort=popular&c=99 where "c" is the product category.
(No matter how I try, I cannot get it to output directly as a sitemap file, as all of the content is in a .tpl file, which doesn't allow doctype to be output as xml).
My next thought was to use MagicParser to create a sitemap from the outputted url above, which would allow automatically generated maps based on the value of "c" changing.
The code I have used (which appears to be fundamentally wrong somewhere) is:
<?php
header("Content-Type: text/xml");
require("MagicParser.php");
print "<?xml version='1.0' encoding='UTF-8'?>";
print "<urlset xmlns='http://www.google.com/schemas/sitemap/0.84' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd'>";
if (!$_GET["c"]) $_GET["c"] = "121";
function myRecordHandler($record)
{
print "<url>";
print "<loc>".$record["FIELD1"]."</loc>";
print "</url>";
}
if ($_GET["c"])
{
$url = "http://www.shopwindow.me.am/feed2.php?iListLimit=100&sListSort=popular";
$url.= "&c=".urlencode($_GET["c"]);
MagicParser_parse($url,"myRecordHandler","csv|44|0|0");
}
print "</urlset>";
?>
This is saved at http://www.me.am/swsitemap.php?c=99 (or whatever value of c), but unfortunately only outputs the header - would anyone know what I have done that is so wrong, please?
Hi,
The only comment I would have on the code is that you should use htmlentities() against the URL in order to make it XML safe. I've added this and ran the code on my server and it seems to work ok - I get the sitemap with all the URLs....
<?php
header("Content-Type: text/xml");
require("MagicParser.php");
print "<?xml version='1.0' encoding='UTF-8'?>";
print "<urlset xmlns='http://www.google.com/schemas/sitemap/0.84' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd'>";
if (!$_GET["c"]) $_GET["c"] = "121";
function myRecordHandler($record)
{
print "<url>";
print "<loc>".htmlentities($record["FIELD1"])."</loc>";
print "</url>";
}
if ($_GET["c"])
{
$url = "http://www.shopwindow.me.am/feed2.php?iListLimit=100&sListSort=popular";
$url.= "&c=".urlencode($_GET["c"]);
MagicParser_parse($url,"myRecordHandler","csv|44|0|0");
}
print "</urlset>";
?>
Are you still only getting the header with this code?
Cheers,
David.
Hi David,
Thanks for the quick reply.
I tries the new code, and still got headers - however I then tried the same script on a different server at a different site:
http://www.madstock.co.uk/swsitemap.php?c=121
... and it appears to work fine.
Is there perhaps a necessity to use a direct path to the input feed, or is this script too "quick" for the input feed (which is created on the fly)?
Sorry for all the questions
Hi Duncan,
That sounds like your server does not have URL Wrappers enabled; which means that PHP can't fopen() a URL. Have a read through this thread on the Magic Parser website for links to the PHP documentation; and the last message which contains something you may be able to add to your .htaccess file to enable URL wrappers...
http://www.magicparser.com/node/189
Cheers,
David.
Thanks David - it appears the problem is more at the server end, as ...
"The script is not opening the page because we prevent scripts connecting to the same server on Port 80."
This is not something that the hosts will change, and as such means that I may try to experiment "bouncing" the script off a couple of servers (which seems like a whole load of hassle to be honest!) before reparsing it at the me.am domain - it will be interesting, to say the least.
Thanks again for your help,
Duncan
Hi Duncan,
Remember that Price Tapestry requires separate feeds per merchant; but it looks like the response from the API would be a collective feed (or at least could be parsed as a feed, it is really a SOAP response) that contains multiple merchants with products matching your query.
Would you therefore, want to try and use the API to get separate feeds for every subscribed merchant just containing the category of products requested?
Cheers,
David.