'baby (Baby)', 'Books' => 'books (Books)', 'classical' => 'classical (Classical Music)', 'dvd' => 'dvd (DVD)', 'electronics' => 'electronics (Electronics)', 'garden' => 'garden (Outdoor Living)', 'kitchen' => 'kitchen (Kitchen & Housewares)', 'magazines' => 'magazines (Magazines)', 'music' => 'music (Popular Music)', 'pc-hardware' => 'pc-hardware (Computers)', 'photo' => 'photo (Camera & Photo)', 'software' => 'software (Software)', 'toys' => 'toys (Toys & Games)', 'universal' => 'universal (Tools & Hardware)', 'vhs' => 'vhs (Video)', 'videogames' => 'videogames (Computer & Video Games)' ); // Sort Types $arModeSortType = array ( 'baby' => array( 'pmrank' => 'Featured Items', 'salesrank' => 'Bestselling', 'titlerank' => 'Alphabetical (A-Z)', ), 'books' => array( 'pmrank' => 'Featured Items', 'salesrank' => 'Bestselling', 'reviewrank' => 'Average Customer Review', 'pricerank' => 'Price (Low to High)', 'inverse-pricerank' => 'Price (High to Low)', 'daterank' => 'Publication Date', 'titlerank' => 'Alphabetical (A-Z)', '-titlerank' => 'Alphabetical (Z-A)', ), 'classical' => array( 'pmrank' => 'Featured Items', 'salesrank' => 'Bestselling', 'titlerank' => 'Alphabetical (A-Z)', ), 'dvd' => array( 'salesrank' => 'Bestselling', 'titlerank' => 'Alphabetical', ), 'electronics' => array( 'pmrank' => 'Featured Items', 'salesrank' => 'Bestselling', 'titlerank' => 'Alphabetical', 'reviewrank' => 'Review', ), 'garden' => array( 'psrank' => 'Featured Items', 'salesrank' => 'Bestselling', 'titlerank' => 'Alphabetical (A-Z)', '-titlerank' => 'Alphabetical (Z-A)', 'manufactrank' => 'Manufacturer (A-Z)', '-manufactrank' => 'Manufacturer (Z-A)', 'price' => 'Price (Low to High)', '-price' => 'Price (High to Low)', ), 'kitchen' => array( 'psrank' => 'Featured Items', 'salesrank' => 'Bestselling', 'titlerank' => 'Alphabetical (A-Z)', '-titlerank' => 'Alphabetical (Z-A)', 'manufactrank' => 'Manufacturer (A-Z)', '-manufactrank' => 'Manufacturer (Z-A)', 'price' => 'Price (Low to High)', '-price' => 'Price (High to Low)', ), 'magazines' => array( 'pmrank' => 'Featured Items', 'salesrank' => 'Bestselling', 'titlerank' => 'Alphabetical (A-Z)', ), 'music' => array( 'psrank' => 'Featured Items', 'salesrank' => 'Bestselling', 'artistrank' => 'Artist Name', 'orig-rel-date' => 'Original Release Date', 'titlerank' => 'Alphabetical', ), 'pc-hardware' => array( 'psrank' => 'Featured Items', 'salesrank' => 'Bestselling', 'titlerank' => 'Alphabetical (A-Z)', '-titlerank' => 'Alphabetical (Z-A)', ), 'photo' => array( 'pmrank' => 'Featured Items', 'salesrank' => 'Bestselling', 'titlerank' => 'Alphabetical (A-Z)', '-titlerank' => 'Alphabetical (Z-A)', ), 'software' => array( 'pmrank' => 'Featured Items', 'salesrank' => 'Bestselling', 'titlerank' => 'Alphabetical', 'price' => 'Price (Low to High)', '-price' => 'Price (High to Low)', ), 'toys' => array( 'pmrank' => 'Featured Items', 'salesrank' => 'Bestselling', 'titlerank' => 'Alphabetical (A-Z)', ), 'universal' => array( 'psrank' => 'Featured Items', 'salesrank' => 'Bestselling', 'titlerank' => 'Alphabetical (A-Z)', '-titlerank' => 'Alphabetical (Z-A)', 'manufactrank' => 'Manufacturer (A-Z)', '-manufactrank' => 'Manufacturer (Z-A)', 'price' => 'Price (Low to High)', '-price' => 'Price (High to Low)', ), 'vhs' => array( 'psrank' => 'Featured Items', 'salesrank' => 'Bestselling', 'titlerank' => 'Alphabetical', ), 'videogames' => array( 'pmrank' => 'Featured Items', 'salesrank' => 'Bestselling', 'titlerank' => 'Alphabetical', 'price' => 'Price (Low to High)', '-price' => 'Price (High to Low)', ), ); // Do not change this constant define('DEVELOPER_TOKEN','MEINTOKEN'); define('DEVELOPER_KEY','MEINKEY'); // XSL live transform Amazon data to HTML (http://xml.amazon.com/onca/xml3)(http://www.amazon.de/exec/obidos/redirect-home?tag=filzhutde&site=home) define('PRODUCT_DETAIL_URL','http://xml.amazon.com/onca/xml3?ManufacturerSearch=O%27Reilly&mode=books-de&sort=%2Bsalesrank&page=1&type=heavy&f=xml&t=MEINEAMZONIDD&dev-t=MEINEAMZONIDDocale=de&'); if (!$sCurrentMode = @$_GET['Mode']) { $sCurrentMode = $amz_kategorie; } // sort by salesRank by default if (!$sCurrentModeSortType = @$_GET['SortBy']) { $sCurrentModeSortType = $amz_sortierung; } if ($sCurrentMode == "books-de") $sCurrentMode = "Books"; $params = array(); $params['AssociateTag'] = ASSOCIATE_ID; $params['Operation'] = 'ItemSearch'; // search for PHP Books by default if (@$_GET['Search']) { error_log ("\n " . $_GET['Search'] ." from $sCurrentMode at ". date("F j, Y, g:i a"), 3, "amazon_search.log"); $params['Keywords'] = utf8_encode($_GET['Search']); } else { $params['Keywords'] = utf8_encode($amz_suchbegriff); } $params['ResponseGroup'] = 'Medium'; $params['SearchIndex'] = $sCurrentMode; $params['Service'] = 'AWSECommerceService'; $params['Sort'] = str_replace('+', '', $sCurrentModeSortType); $sUrl = aws_signed_request('de', $params, DEVELOPER_TOKEN, DEVELOPER_KEY); function aws_signed_request($region, $params, $public_key, $private_key) { /* Copyright (c) 2009 Ulrich Mierendorff Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* Parameters: $region - the Amazon(r) region (ca,com,co.uk,de,fr,jp) $params - an array of parameters, eg. array("Operation"=>"ItemLookup", "ItemId"=>"B000X9FLKM", "ResponseGroup"=>"Small") $public_key - your "Access Key ID" $private_key - your "Secret Access Key" */ // some paramters $method = "GET"; $host = "ecs.amazonaws.".$region; $uri = "/onca/xml"; // additional parameters $params["Service"] = "AWSECommerceService"; $params["AWSAccessKeyId"] = $public_key; // GMT timestamp $params["Timestamp"] = gmdate("Y-m-d\TH:i:s\Z"); // API version $params["Version"] = "2009-03-31"; // sort the parameters ksort($params); // create the canonicalized query $canonicalized_query = array(); foreach ($params as $param=>$value) { $param = str_replace("%7E", "~", rawurlencode($param)); $value = str_replace("%7E", "~", rawurlencode($value)); $canonicalized_query[] = $param."=".$value; } $canonicalized_query = implode("&", $canonicalized_query); // create the string to sign $string_to_sign = $method."\n".$host."\n".$uri."\n".$canonicalized_query; // calculate HMAC with SHA256 and base64-encoding $signature = base64_encode(hash_hmac("sha256", $string_to_sign, $private_key, True)); // encode the signature for the request $signature = str_replace("%7E", "~", rawurlencode($signature)); // create request $request = "http://".$host.$uri."?".$canonicalized_query."&Signature=".$signature; return $request; } ?>