additional_plugins/alpha/serendipity_event_motm/amazon/amazonsearch.php
Matthias Mees 24ee209520 Move deprecated plugins to alpha, a.k.a. Siberia
These plugins have been identified as deprecatable at #s9ycamp2017.
They use service that no longer exist or provide features that no
longer make sense or have been replaced.

We won't miss them.

References s9y/Serendipity#499
2017-04-13 20:53:16 +02:00

26 lines
No EOL
730 B
PHP

<?php
function amazon_search($term,$associate_id,$dev_key)
{
require_once('AmazonProduct.class.php');
require_once('AmazonSearchEngine.class.php');
require_once "HTTP/Request.php";
$term = urlencode($term);
/* Create a new AmazonSearchEngine instance, with your developer key and associates ID */
$se = new AmazonSearchEngine($dev_key, $associate_id);
if (isset($_GET['do']) && $_GET['do'] == 'related') {
$se->searchRelated($term);
} else {
$se->searchTerm($term);
}
/* Call the search method with your search term */
$counter = 0;
if ($se->results[0])
return $se->results[0];
else
return false;
}
?>