Example #1
0
 function ItemSearch($search_index, $options = array())
 {
     // SearchIndex ではなく Category が渡された
     if (array_key_exists($search_index, $this->_categoryToSearchIndex)) {
         $search_index = $this->_categoryToSearchIndex[$search_index];
     }
     $result = parent::ItemSearch($search_index, $options);
     return $result;
 }
function amazon_asin_anfrage($asin)
{
    global $produkt;
    $amazon = new Services_Amazon("0VVNZKPPSV6JSP0ZKVG2", "8l6msSRF9jG37FPNvWU0r2uxoP2Gr7V/zJqXmjZo");
    $amazon->setLocale("DE");
    $options = array();
    $options['ResponseGroup'] = 'Images,Offers,Small';
    $options['MerchantId'] = 'A3JWKAKR8XB7XF';
    $result = $amazon->ItemLookup($asin, $options);
    //var_dump($result);
    if (PEAR::isError($result)) {
        return false;
    }
    $produkt[IMAGEURLSMALL] = $result["Item"][0]["SmallImage"]["URL"];
    $produkt[IMAGEURLMEDIUM] = $result["Item"][0]["MediumImage"]["URL"];
    $produkt[PRODUCTNAME] = $result["Item"][0]["ItemAttributes"]["Title"];
    $produkt[OURPRICE] = $result["Item"][0]["Offers"]["Offer"]["OfferListing"]["Price"]["Amount"];
    $produkt[OURPRICE] /= 100;
    $produkt[CATALOG] = $result["Item"][0]["ItemAttributes"]["ProductGroup"];
    return true;
}
    $page = 1;
    if (isset($_GET['page'])) {
        $page = $_GET['page'];
    }
    if (empty($_GET['keyword'])) {
        $message = 'Must search for something.';
    } else {
        $keyword = $_GET['keyword'];
        $products = $amazon->searchKeyword($keyword, $mode, $page);
        if (PEAR::isError($products)) {
            $message = $products->message;
            $products = null;
        }
    }
}
$modes = Services_Amazon::getModes();
$modes[''] = 'All Modes';
echo <<<EOT
<form action="{$_SERVER['PHP_SELF']}" method="get">
<table border="0">
<tr>
    <td>
    <select name="mode">
EOT;
foreach ($modes as $mode => $name) {
    echo '<option value="' . $mode . ($mode == $_GET['mode'] ? '" selected="selected"' : '') . '">' . htmlentities($name) . '</option>';
}
echo <<<EOT
    </select>
    </td>
    <td><input type="text" name="keyword" value="{$keyword}" /></td>
Example #4
0
<?php

// 取得したアクセスキーを設定してください。このままでは動作しません。
// アクセスキーID
define('ACCESSKEY_ID', 'あなたのアクセスキーID');
// シークレットアクセスキー
define('SECRETACCESSKEY', 'あなたのシークレットアクセスキー');
// トラッキングID
define('TRACKKING_ID', 'あなたのトラッキングID');
require_once 'Services/Amazon.php';
$amazon = new Services_Amazon(ACCESSKEY_ID, SECRETACCESSKEY, TRACKKING_ID);
$amazon->setLocale('JP');
$category = 'Books';
$options['Keywords'] = 'マイナビ';
$options['ResponseGroup'] = 'Images,ItemAttributes';
$result = $amazon->ItemSearch($category, $options);
var_dump($result);
Example #5
0
<?php

// 取得したアクセスキーを設定してください。このままでは動作しません。
// アクセスキーID
define('ACCESSKEY_ID', 'あなたのアクセスキーID');
// シークレットアクセスキー
define('SECRETACCESSKEY', 'あなたのシークレットアクセスキー');
// トラッキングID
define('TRACKKING_ID', 'あなたのトラッキングID');
require_once 'Services/Amazon.php';
$amazon = new Services_Amazon(ACCESSKEY_ID, SECRETACCESSKEY, TRACKKING_ID);
$amazon->setLocale('JP');
$amazon->ItemSearch('Books', ['Keywords' => '本']);
$xml = $amazon->getRawResult();
print $xml;
ausgabe("Scriptstart");
ini_set("include_path", ".:/kunden/116846_36208/pear/PEAR:/usr/local/lib/php");
require_once 'PEAR.php';
require_once 'Services/Amazon.php';
//ausgabe ("Deutsches Datum"); Deaktiviert wegen settype
//setlocale(LC_ALL, "ge");
ausgabe("Amazon.inc einfgen");
include "../../amazon.inc";
ausgabe("Erstelle Variablen");
$produkt_amazon[1] = "1";
$mysql_host = "mysql4.priceguard.de";
$mysql_user = "******";
$mysql_pass = "******";
$mysql_db = "db116846_14";
$name = "Amazon.de Pricewatch";
$amazon = new Services_Amazon("0VVNZKPPSV6JSP0ZKVG2", "8l6msSRF9jG37FPNvWU0r2uxoP2Gr7V/zJqXmjZo");
$amazon->setLocale("DE");
$amazon_options = array();
$amazon_options['ResponseGroup'] = 'Offers';
$amazon_options['MerchantId'] = 'A3JWKAKR8XB7XF';
// Datenbank Verbindung aufbauen
$lk = connect_db();
// Daten aus der Datenbank auslesen
ausgabe("USER aus Datenbank auslesen");
if (!($user_db = query_db("SELECT HIGH_PRIORITY ID, EMAIL FROM pricewatch_user"))) {
    ausgabe("ABRUCH");
    sendebericht();
    exit;
}
while ($user = mysql_fetch_array($user_db, MYSQL_ASSOC)) {
    $email_text = "";