私は簡単な質問をしています。実際に私はAmazonのAPIを使ってASINコードから製品に関する情報を得ることができますが、このイメージのケースでは、大きなフォーマット、中間のサムフォーマットなどの異なるフォーマットで1つのイメージを得ることができますか?Amazon API製品からすべての画像を取得
私の場合、製品からすべての画像を取得できるかどうかを知りたければ、scrappを使用してすべての画像を取得できるかどうかは別の形式の画像を表示するだけではありませんが、
$gallery=htmlentities((string) $item->ImageSets->ImageSet->LargeImage->URL);
アイテムの構造::
実際に私はこれを使用して、よりきれいだとCURLから多くのクエリでhaven't問題をscrappを使用して
機能APIコード:
function getAmazonPrice($region, $asin)
{
global $precioamz;
global $amountamz;
global $imageamz;
global $galeriaamz;
$xml = aws_signed_request($region, array(
"Operation" => "ItemLookup",
"ItemId" => $asin,
"IncludeReviewsSummary" => False,
"ResponseGroup" => "Medium,OfferSummary",
));
$item = $xml->Items->Item;
$title = htmlentities((string) $item->ItemAttributes->Title);
$url = htmlentities((string) $item->DetailPageURL);
$image = htmlentities((string) $item->MediumImage->URL);
$price = htmlentities((string) $item->OfferSummary->LowestNewPrice->Amount);
$amount=htmlentities((string) $item->OfferSummary->LowestNewPrice->Amount);
$item->OfferSummary->LowestUsedPrice->Amount);
$code = htmlentities((string) $item->OfferSummary->LowestNewPrice->CurrencyCode);
$qty = htmlentities((string) $item->OfferSummary->TotalNew);
$gallery=htmlentities((string) $item->ImageSets->ImageSet->LargeImage->URL);
/// $gallery=Images,ItemAttributes,Variations,VariationImages
if ($qty !== "0")
{
$response = array(
"code" => $code,
"price" => number_format((float) ($price/100), 2, '.', ''),
"image" => $image,
"url" => $url,
"title" => $title,
"amount" => $amount,
"galeria" => $gallery
);
}
$precioamz=$response['price'];
$amountamz=$response['amount'];
$imageamz=$response['image'];
$galeriaamz=$response['galeria'];
//return $response;
}
function getPage($url)
{
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_FAILONERROR, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$html = curl_exec($curl);
curl_close($curl);
return $html;
}
しかし、唯一の1枚の画像を取得し、私はこの製品のすべての画像を取得したい、助けのためthank's、私は誤解されない場合は
@Jos私はあなたのために働いているかどうか知っていますか? –
いいえ、私の質問では、製品からのすべてのイメージについて話します。アマゾンで製品を見ると、APIからさまざまなサイズや解像度の画像が1つしか得られません。実際に私はパーサロードDOM製品を使用してウェブサイトをロードし、この画像とデータベースに表示すると、すべての画像を表示することができますが、問題は、それは、Amazon'sからAPIは、私には単一のイメージを表示するだけで、他のイメージは可能ですかどうかわかりませんAmazonのAPIのみを使用して表示 – Jos