Permalink
Browse files

* New Dir Structure

  • Loading branch information...
1 parent e61fc67 commit 68d412dc90bb0d7ebd5544fad6f96b3f39791d8d @Exeu committed Jan 14, 2011
Showing with 2 additions and 175 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 lib/AmazonECS.class.php
  3. +0 −58 testAssociateTag.php
  4. +0 −36 testItemLookup.php
  5. +0 −74 testItemSearch.php
  6. +0 −6 testSettings.php-dist
View
@@ -2,3 +2,4 @@
*.buildpath
*.project
testSettings.php
+sampleSettings.php
View
@@ -12,7 +12,7 @@
*
* @package AmazonECS
* @license http://www.gnu.org/licenses/gpl.txt GPL
- * @version 1.0
+ * @version 1.1-DEV
* @author Exeu <exeu65@googlemail.com>
* @link http://github.com/Exeu/Amazon-ECS-PHP-Library/wiki Wiki
* @link http://github.com/Exeu/Amazon-ECS-PHP-Library Source
View
@@ -1,58 +0,0 @@
-<?php
-/**
- * WARNING: This only works with version >= 1.0 of the AmazonECS library
- */
-
-if ("cli" !== PHP_SAPI)
-{
- echo "<pre>";
-}
-
-if (is_file('testSettings.php'))
-{
- include 'testSettings.php';
-}
-
-defined('AWS_API_KEY') or define('AWS_API_KEY', 'API KEY');
-defined('AWS_API_SECRET_KEY') or define('AWS_API_SECRET_KEY', 'SECRET KEY');
-defined('AWS_ASSOCIATE_TAG') or define('AWS_ASSOCIATE_TAG', 'ASSOCIATE TAG');
-defined('AWS_ANOTHER_ASSOCIATE_TAG') or define('AWS_ANOTHER_ASSOCIATE_TAG', 'ANOTHER ASSOCIATE TAG');
-
-require 'lib/AmazonECS.class.php';
-
-try
-{
- // get a new object with your API Key and secret key.
-
- // Added in version 1.0 is the new optional parameter to set up an AssociateTag (AssociateID)
- $amazonEcs = new AmazonECS(AWS_API_KEY, AWS_API_SECRET_KEY, 'DE', AWS_ASSOCIATE_TAG);
-
- /**
- * Now you can work the normal way with the class with the difference
- * that every URL in the response contains your AssociateTag
- */
-
- $response = $amazonEcs->category('DVD')->responseGroup('Large')->search("Matrix Revolutions");
- //var_dump($response);
-
- // searching again
- $response = $amazonEcs->search('Bud Spencer');
- //var_dump($response);
-
- // Use the new Setter to update your AssociateTag on the fly
- $response = $amazonEcs->associateTag(AWS_ANOTHER_ASSOCIATE_TAG)->search('Bud Spencer');
- //var_dump($response);
-
-
- // For more examples please look at testItemSearch.php and testItemLookup.php
- // These examples also could be used with the AssociateTag
-}
-catch(Exception $e)
-{
- echo $e->getMessage();
-}
-
-if ("cli" !== PHP_SAPI)
-{
- echo "</pre>";
-}
View
@@ -1,36 +0,0 @@
-<?php
-if ("cli" !== PHP_SAPI)
-{
- echo "<pre>";
-}
-
-
-if (is_file('testSettings.php'))
-{
- include 'testSettings.php';
-}
-
-defined('AWS_API_KEY') or define('AWS_API_KEY', 'API KEY');
-defined('AWS_API_SECRET_KEY') or define('AWS_API_SECRET_KEY', 'SECRET KEY');
-
-require 'lib/AmazonECS.class.php';
-
-try
-{
- $amazonEcs = new AmazonECS(AWS_API_KEY, AWS_API_SECRET_KEY, 'DE');
-
- $response = $amazonEcs->responseGroup('Large')->lookup('B0017TZY5Y');
- //var_dump($response);
-
- $response = $amazonEcs->responseGroup('Images')->lookup('B0017TZY5Y');
- //var_dump($response);
-}
-catch(Exception $e)
-{
- echo $e->getMessage();
-}
-
-if ("cli" !== PHP_SAPI)
-{
- echo "</pre>";
-}
View
@@ -1,74 +0,0 @@
-<?php
-if ("cli" !== PHP_SAPI)
-{
- echo "<pre>";
-}
-
-if (is_file('testSettings.php'))
-{
- include 'testSettings.php';
-}
-
-defined('AWS_API_KEY') or define('AWS_API_KEY', 'API KEY');
-defined('AWS_API_SECRET_KEY') or define('AWS_API_SECRET_KEY', 'SECRET KEY');
-
-require 'lib/AmazonECS.class.php';
-
-try
-{
- // get a new object with your API Key and secret key. Lang is optional.
- // if you leave lang blank it will be US.
- $amazonEcs = new AmazonECS(AWS_API_KEY, AWS_API_SECRET_KEY, 'DE');
-
-
- // changing the category to DVD and the response to only images and looking for some matrix stuff.
- $response = $amazonEcs->category('DVD')->responseGroup('Images')->search("Matrix Revolutions");
- //var_dump($response);
-
- // from now on you want to have pure arrays as response
- $amazonEcs->setReturnType(AmazonECS::RETURN_TYPE_ARRAY);
-
- // searching again
- $response = $amazonEcs->search('Bud Spencer');
- //var_dump($response);
-
- // and again... Changing the responsegroup and category before
- $response = $amazonEcs->responseGroup('Small')->category('Books')->search('PHP 5');
- //var_dump($response);
-
- // category has been set so lets have a look for another book
- $response = $amazonEcs->search('MySql');
- //var_dump($response);
-
- // want to look in the US Database? No Problem
- $response = $amazonEcs->country('us')->search('MySql');
- //var_dump($response);
-
- // or Japan?
- $response = $amazonEcs->country('jp')->search('MySql');
- //var_dump($response);
-
- // Back to DE and looking for some Music !! Warning "Large" produces a lot of Response
- $response = $amazonEcs->country('de')->category('Music')->responseGroup('Large')->search('The Beatles');
- //var_dump($response);
-
- // Or doing searchs in a loop?
- for ($i = 1; $i < 4; $i++)
- {
- $response = $amazonEcs->search('Matrix ' . $i);
- //var_dump($response);
- }
-
- // Want to have more Repsonsegroups? And Maybe you want to start with resultpage 2?
- $response = $amazonEcs->responseGroup('Small,Images')->optionalParameters(array('ItemPage' => 2))->search('Bruce Willis');
- //var_dump($response);
-}
-catch(Exception $e)
-{
- echo $e->getMessage();
-}
-
-if ("cli" !== PHP_SAPI)
-{
- echo "</pre>";
-}
View
@@ -1,6 +0,0 @@
-<?php
-define('AWS_API_KEY', 'API KEY');
-define('AWS_API_SECRET_KEY', 'SECRET KEY');
-define('AWS_ASSOCIATE_TAG', 'ASSOCIATE TAG');
-define('AWS_ANOTHER_ASSOCIATE_TAG', 'ANOTHER ASSOCIATE TAG');
-

0 comments on commit 68d412d

Please sign in to comment.