You are here

function amazon_search_simple_search in Amazon Product Advertisement API 6

Same name and namespace in other branches
  1. 7.2 amazon_search/amazon_search.module \amazon_search_simple_search()
  2. 7 amazon_search/amazon_search.module \amazon_search_simple_search()
1 call to amazon_search_simple_search()
amazon_search_search in amazon_search/amazon_search.module
Implementation of hook_search(). Implements remote Amazon searching.

File

amazon_search/amazon_search.module, line 35

Code

function amazon_search_simple_search($keywords = '', $parameters = array()) {
  $parameters += array(
    'ResponseGroup' => 'ItemAttributes,EditorialReview',
    'SearchIndex' => 'Blended',
  );
  $parameters['Keywords'] = urlencode($keywords);
  drupal_alter('amazon_search_parameters', $parameters);
  $items = array();
  $results = amazon_http_request('ItemSearch', $parameters);
  foreach ($results->Items->Item as $xml) {
    $item = amazon_item_clean_xml($xml);
    $items[$item['asin']] = $item;
  }
  return $items;
}