Jaap's free Amazon Web Services Script in PHP

If you have copied this script some time ago and want to make money you have to upgrade or modify your script!

Introduction

This page describes my PHP script that can interface with the XML version of Amazon's Web Services (AWS, later renamed to ECS). It also contains links to more information about PHP and ECS and to sites with other scripts (also in other languages).
But have a look at my demo page first, so you see what it is all about!

Different scripts

The script consists of several subscripts and each script is reachable under three names: When you call it with the .php extension, the script will be executed on this server and when you call it with the .phps extension (which stands for PHP Source) or the .txt extension you can look at the source code and save it on your own computer.
20091129: One .php file can't be downloaded and that is the file with my keys (that I have to keep secret according to Amazon).
But just run the script and it will tell you what to do.

The most recent not backwards compatible requirement by Amazon

20090627: After 20090815, requests to Amazon's Web Services have to be 'signed'. I have implemented this in my script some days ago with the help of a script by Ulrich Mierendorff. See mierendo.com/software/aws_signed_query/. I have slightly changed his script so you have to download my version and not use his.

Test the script
Source code as gzipped tar archive
Source code as .phps file(s)
Source code as .txt file(s)
Comment
Which one to use
amazonv4.php amazon4all.tgz amazonv4.phps data.phps data_v4.phps aws.phps aws_signed_request.phps language.phps amazonv4.txt data.txt data_v4.txt aws.txt aws_signed_request.txt language.txt Most people will want to start building upon this script. It's the most advanced one and should be able to do everything that the others can do and more. This is a version that works with ECS 4.0 instead of ECS 3.0.

Details

explanation.htm - more detailed explanation of the scripts (you don't need to read this to use them)

How to install

Advantages of these scripts over others

20090627: Some of these points are no longer valid after Amazon enforced it's signed request policy since 20090815.
Some things all these scripts have in common:

Sites using this script

where what author 20091129: checked
books-video.bali-portal.com/ Bali books and movies Bert Vierstra hasn't converted yet
www.caphotos.com/books_photo.html Photography Books Eric hasn't converted yet
www.classiccat.net/ Classical music MP3's Wim Roffel still using the script?
www.mediarights.org/ Documentary Films Arts Engine, Inc. Doesn't seem to use the script anymore

(Let me know if you also have a site using this script or know of one.)

A database of ECS error messages

Because of a discussion on the forum, I have set up a database of error messages.

where what
errorlist.php Database of ECS error messages

If you run another script and want to add any encountered errors to this database too, you can link to www.chipdir.nl/amazon/listerror.php?do=add&da=URL encoded error message
I'll add a way to the script to get a text file with all the error messages. Let me know when you're interested in the source code.

Official data from Amazon about their Web Services

where what
developer.amazonwebservices.com/connect/entry.jspa?externalID=636&categoryID=12 Nice introduction to the API and using PHP to show the results
www.amazon.com/gp/aws/sdk/?v=2005-03-23&s=AWSEcommerceService ECS 4.0 documentation
www.amazon.com/gp/aws/landing.html/ News about Amazon Web services
forums.prospero.com/am-assocdevxml Amazon's web services forum
associates.amazon.com/ Amazon associates
aws.typepad.com/ AWS Blog: announcements and news
aws.typepad.com/aws/developer_tools/ AWS Blog: developer tool news

More about PHP

where what
www.php.net/ official PHP site
www.php.net/manual/en/ English manual
www.php.net/manual/en/tutorial.php tutorial part of the English manual
www.php.net/docs.php choose another manual version

Scripts and source code by others

PHP

where author comment
www.awsbook.com/ Jason Levitt's book
www.igrep.com/search.php?ac=&searchphrase=amazon+php Several articles
www.phpclasses.org/browse/author/28750.html Amazon Lite by Daniel Kushner
amazoop.sourceforge.net/ Madd0 Used on www.madd0.com/
associatesshop.filzhut.net/download/ Daniel Filzhut Not free when you earn $50 or more per quarter with it.
forums.prospero.com/am-assocdevxml/messages?msg=2808.3 Lowflyer_taw
forums.prospero.com/n/mb/message.asp?webtag=am-assocdevxml&msg=3444.1&ctx=0 Gr82meetu78
owlcroft.com/PHP/ Eric Walker
pear.php.net/package/Services_Amazon Official PHP extension for Amazon (since 2004-08-13)
scripts.incutio.com/amazon/ Simon at Incutio
sourceforge.net/projects/amazonlib/ former PIA project at Vertexdev.com
www.chipdir.nl/amazon/ Jaap van Ganswijk You're already looking at it.
www.phpshop.org/ Edikon Free under GPL
www.scriptrocket.com/ Piranha Feed by Script Rocket. Needs MySQL costs $39.95+VAT.
www.soundkeepers.com/amazon/ Tokenizer

XSLT

where author
www.amazon.com/gp/browse.html/ref=sc_bb_l_0?node=3427431 Amazon
www.electronics-tutorials.com/web-services/web-services-with-xslt.htm Ian C. Purdie

Perl

where author
www.mrrat.com/aws/ Mr. Rat
www.c3scripts.com/amazon/ Associate Engine by Cusimano.com Costs $99.95 the first year and $24.95 per every next year. Unix/Linux only.
www.ass.datenstudio.de/ ASS - Aktiv Shop System by Datenstudio.de German only. Costs 49 or 99 euro.

ASP

where author
kokogiak.com/amazon/about.asp Kokogiak Media / Alan Taylor

Ruby

where author
freshmeat.net/projects/ruby-amazon/ Ian Macdonald

Other sites with script lists

where author
www.awszone.com/ Elena (works for Amazon)

Other relevant sites

where author
lcweb.loc.gov/z3950/agency/resources/ Library of Congress books database
lcweb.loc.gov/z3950/gateway.html Library of Congress books database
www.browsenodes.com/ Site with database with AWS browsenodes
www.browsenodes.co.uk/ Sister site with browsenodes for Amazon.co.uk
www.imdb.com/ Internet Movie Database

Amazon Hacks: O'Reilly's book about Amazon's Web Services

www.oreilly.com/catalog/amazonhks/ About the book
safari.oreilly.com/?XmlId=0-596-00542-3 Online version of the book
www.amazon.com/exec/obidos/ASIN/0596005423/ref=nosim/chipdir/ Order from Amazon

Links checked: 2008-03-06
Jaap van Ganswijk