A PHP library class to working with Amazon Product Advertising API, for working with the latest version of Amazon Product Advertising API (2011-08-01).
Requirements :
Features :
I have created this library to helping people working with Amazon Product Advertising API. Using PHP 5.3 version and latest PHP features such as namespace and lambda function, and also latest Amazon Product Advertising API.
For now, this library only supports two main operations :
Installation
Copy the library into your working folder, and set library folder into your php include_path settings.
Examples :
set_include_path(get_include_path() . PATH_SEPARATOR.YOUR_ROOT.YOUR_DS . 'php-amazon-pa-wrapper')complete code : https://gist.github.com/2177610
How To Use
This library only support two common amazon product advertising API process :
Search request code example :
<?php
/*
* set operations
*/
$amazon->request()->search('php');
$amazon->request()->setParams(array(
'SearchIndex' => 'Books',
'ResponseGroup' => 'Large'
));
//get response data from sended request
$amazon->response()->proceed($amazon->request()->send());
//debug function is my custom function to 'print_r' any variables, you can use your own function.
//getItems will return all items data from amazon response
debug($amazon->response()->getItems());
To use Search operation, please do not forget to include 'SearchIndex' when you use setParams.
ItemLookup example:
<?php
/*
* set operations
*/
$amazon->request()->detail('0596157134');
$amazon->request()->setParams(array(
'ResponseGroup' => 'Large'
));
$amazon->response()->proceed($amazon->request()->send());
debug($amazon->response()->getItems());
Response data :
Seems to work really well and is easy to use (esp after finding that Amazon's own PHP APIs seem to all be dead!)
g8 component,
Questions & Comments