January 18, 2008
This is a small tutorial on how you can retrieve products from Amazon’s Associates Web Service. I’m not the biggest fan of Amazon’s affiliate program. The biggest reason is the one day cookie. I like programs that produce results, and I’ve always struggled with this program. When I talk to others that do have success, it definitely seems like you need a large volume of visitors, and it appears to be quite seasonally dependent.
Regardless, I wanted to show how you can make calls against their web service. The first step is to be a Amazon associate (https://affiliate-program.amazon.com/). Here you will get an associate tag (usually something-20). This allows you to receive commissions by creating widgets, etc. But we want to use the AWS (Amazon Web Service), so you must be a Amazon developer. So this step will involve us going to the Amazon Web Service web site (http://aws.amazon.com). After creating account you will need to create a token. Basically, this is a password used to login to Amazon’s web service. Look for a button on the upper right hand section called ‘Your Web Serices Account’, click on AWS Access Identifiers. Look for something down in the content called Access Key ID. You may need to generate them. To make the calls we’ll need the Access Key AND your Amazon associate tag.
January 10, 2008
There was a comment a couple of days ago about CJ WebService Version 2. I did get this to work. I found some good code another programmer put together that access the v2 WSDL. Basically, this is my API test script, so you need to manually add your keywords and advertiser ID in the code, but it’s a proof of concept. I think I’ve abandoned the CJ API. I personally think it’s not that consistent. I often get ‘internal server error’ in the response XML. I think it might be a riskier move to go version 2 for real time calls.. just my two cents.
This version needs PHP5 with SOAP services built into PHP (–enable-soap). Also it’s using try/catch for handling SOAP exception and it’s only available in PHP5.
As I mentioned above, I’m pretty much ditching CJ web services all together. I still use eBay’s API, but CJ’s seems a little off for me. I’m doing initial tests with CJ Data Feeds now, and this really appears to be the direction I need to go.
January 10, 2008
I’ve been playing CJ product feeds (xml format), and came across a strange problem accessing the feed programatically using PHP’s built FTP (–enable-ftp) functionality. FTPing to the site with any FTP client, even with command line FTP was no problem, but as soon as went from script the application would hang on the ftp_get() call. My firewall logs were showing lost return connections, so it almost seemed that they’re rejecting traffic. I played with passive (on|off) as well as format (ASCII|BINARY) and the result was the same.
Doing a little googling I found other CJ users having the same problem with PHP and CJ Data Feeds. I think there is a FTP client flag that indicates that it’s PHP and they’re blocking it for security reasons. Probably to aide in stopping script spawned FTP brute force attacks?? Not sure. So, that still leaves me with a problem.. I’m unable to download the feeds with my script, but luckily there is always a million ways to skin an internet cat.
October 4, 2007
Here is a an extremely simple way of returning a RSS result from eBay and splitting it up into pages. Some people don’t want to show 100 results, at a time, but also not be limited to show 10 results, etc. If this is the case, then paging is the key.
I’ll break my examples into pieces, and at the end offer the completed script so you can see it all in one piece.