Amazon Associates API (data source) for CakePHP
Posted by Felix Geisendörfer, on Jul 31, 2008 - in PHP & CakePHP » DataSources, Models & Behaviors
Hey folks,
just wanted to let you know about a new addition to the debuggable scraps repository: An API for the Amazon Associates Web Service. Right now it's really just a simple wrapper to allow you to search their catalog since that was all I needed for now. But thanks to the almighty fork button on github you can easily change that ; ).
Using the API is as simple as:
-
class AmazonController extends AppController{
-
-
function index() {
-
// Only needed if no Model has been loaded so far
-
App::import('ConnectionManager');
-
-
$amazon = ConnectionManager::getDataSource('amazon');
-
debug($response);
-
exit;
-
}
-
}
Documentation and code can be found here: Download the Amazon Associates API for CakePHP.
Hint: If you are looking for DVD covers you'll have to pass 'info' => 'Images' as a second query option.
Alright, hope that's useful to some of you out there : ),
-- Felix Geisendörfer aka the_undefined