When querying Amazon services with Zend (Zend_Service_Amazon), how to sort results by date?
I have begun using Zend with PHP to run product searches against Amazon. However, I can't figur开发者_开发知识库e out how to sort the products by date -- since I want to find the most recent products which match my keywords. The Amazon documentation doesn't have much information on how to sort results. Here's my code:
$amazon = new Zend_Service_Amazon('AMAZON_API_KEY', 'US', 'AMAZON_SECRET_KEY');
$results = $amazon->itemSearch(array('SearchIndex' => 'Books',
'Keywords' => 'Cooking'
));
foreach ($results as $result) {
echo $result->Title . '<br />';
}
Tried using the Sort
parameter?
Parameter values may be found here - http://docs.amazonwebservices.com/AWSEcommerceService/2006-11-14/ApiReference/SortValuesArticle.html
精彩评论