00001 <?
00002 class Amazon extends REST
00003 {
00004 function __construct($key = null)
00005 {
00006
00007 if ($key !== null)
00008 $this->key = $key;
00009 else if (Config::get('amazon_aws_key'))
00010 $this->key = Config::get('amazon_aws_key');
00011
00012
00013 parent::__construct('http:
00014 }
00015
00016 public function lookupAsins($search, $searchIndex = null)
00017 {
00018
00019 $asins = array();
00020
00021
00022 if ($searchIndex === null)
00023 $searchIndex = 'Blended';
00024
00025
00026 $data = $this->request(array(
00027 'Operation' => 'ItemSearch',
00028 'Keywords' => $search,
00029 'SearchIndex' => $searchIndex,
00030 'ResponseGroup' => 'ItemIds'
00031 ));
00032
00033
00034 $xml = simplexml_load_string($data);
00035 $list = $xml->Items;
00036 foreach ($list->Item AS $item)
00037 $asins[] = (string)$item->ASIN;
00038
00039 return $asins;
00040 }
00041 }
00042 ?>