felixge / debuggable-scraps

MIT licensed code without warranty ; )

This URL has Read+Write access

felixge (author)
Thu Mar 05 17:58:47 -0800 2009
commit  69be803603ef440f4cc7d0e6319641ac016248cb
tree    e60a50275a1d3a728163a2c0caa84343325d7240
parent  fd0e5ad625cb21f5ba16e6b186821a5774089ac7
debuggable-scraps / cakephp / datasources / amazon_associates
cakephp/datasources/amazon_associates/readme.textile

CakePHP Amazon Associates Data Source

A CakePHP datasource for interacting with the amazon associates API. You can do cool stuff like finding images for Movies, Books and other products with it and then earn commisions on referals via Amazon’s associate program.

If you don’t have an amazon API key you can get one here: Get Amazon API key

Usage / Docs

Installing

1. Copy amazon_associates_source.php to app/models/datasources/
2. Open your app/config/database.php and add the following:


var $amazon = array(
	'datasource' => 'amazon_associates',
	'key' => 'your-amazon-key'
);

3. Create app/controllers/amazon_controlle.php with the following code:


class AmazonController extends AppController{
	var $uses = array();

	function index() {
		// Only needed if no Model has been loaded so far
		App::import('ConnectionManager');

		$amazon = ConnectionManager::getDataSource('amazon');
		$response = $amazon->find('DVD', array('title' => 'The Devil and Daniel Johnston'));
		debug($response);
		exit;
	}
}

4. Access the /amazon action of your app and look at the resultset.
5. Take a look at the available query options.

Missing Features

  • Implement missing operations (fork contributions welcome!):
    • BrowseNodeLookup
    • CartAdd
    • CartClear
    • CartCreate
    • CartGet
    • CartModify
    • CustomerContentLookup
    • CustomerContentSearch
    • Help
    • ItemLookup
    • ListLookup
    • ListSearch
    • SellerListingLookup
    • SellerListingSearch
    • SellerLookup
    • SimilarityLookup
    • TagLookup
    • TransactionLookup
  • Read associates tag from db config
  • Possibly other things, see Amazon API documentation

Known Bugs

None