ถ้าเรามี ASIN ของสินค้า แล้วเราจะดึงค่าชื่อ ราคา .... จาก Amazon ยังไงครับ

เริ่มโดย seemee, 14 มิถุนายน 2011, 10:04:35

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

seemee

พอดีอยากลองทำโปรแกรมดูบ้าง แต่ไม่รู้การเอาค่าต่างๆ มาเขียนเป็นโปรแกรมเลยครับ ต้องไปเอามาจากไหนครับ
และถ้าจะเอาขั้นแรกคือ ชื่อ + ราคา ต้องทำยังไงครับ
:wanwan044: :wanwan044:
[direct=http://bluetrustloanslogin.com]bluetrustloanslogin.com[/direct]

toteetime

ถ้าจะเอาแบบเต็มรูปแบบ แต่ยากนิดนึง ก็ต้องไปเรียกใช้ API ที่ Amazon เตรียมไว้ให้แล้ว
จะเขียนด้วย PHP หรือ C# ก็ตามแต่ถนัดหรือจุดประสงค์การใช้งาน

แต่ถ้าจะเอาง่ายๆ ใช้ iMacro ก็น่าจะได้แล้ว น่าจะง่ายกว่าวิธีข้างบน
ผู้มีปัญญามีความพินิจ ย่อมตั้งตัวได้ ด้วยต้นทุนแม้น้อย ดุจคนก่อไฟน้อย ๆ ให้เป็นกองใหญ่ได้ฉะนั้น


backhold

ราคาเราไม่ควรดึงมาให้ลูกค้าเห็น เราต้องการให้ลูกค้าเกิดความสนใจและเข้าไปที่ Amazon อย่างน้อยเราก็ได้ คุกกี้ อีกอย่างราคามันปรับตลอด
[direct=http://xn--72cha8bn0dfs7cqc5c4lc7.blogspot.com/]ขายเซ็นเซอร์ถอยหลัง[/direct]
[direct=http://xn--12cbvb4f6au1kxa1b3fxb.blogspot.com/]ไฟฉุกเฉิน[/direct]
[direct=http://xn--ledt8-59qwgzbt.blogspot.com/]หลอด T8 LED[/direct]
[direct=http://www.pantipmarket.com/mall/sensor/?node=products&id=249946/]ขาย SENSOR ถอยหลัง[/direct]
[direct=http://xn--daylight-hoz4n6a0p1i.blogspot.com/]ขายไฟ daylight[/direct]

ohmohm

ดึงราคา ชื่อ ใช้ Operation ItemLookup และ  ResponseGroup Large

<?php  /* http://forums.thaisem.com/index.php?topic=8265 */
include("includes/request.php"); // http://mierendo.com/software/aws_signed_query/ aws_signed_request() in here
$public_key 'xxxxxxxxxxxxxxx';  // your public key
$private_key 'xxxxxxxxxxxxxxxx'// your private key
$tag 'YOUR_TAG_HERE-20' // your affilliate tag 
$asin 'B0000000'// your ASIN
$parsed_xml aws_signed_request('com', array('Operation'=>'ItemLookup','ItemId'=>"$asin",'ResponseGroup'=>'Large','AssociateTag'=>"$tag"), $public_key$private_key);
header('Content-type: text/xml');
print 
$parsed_xml->saveXML();


http://www.thaiseoboard.com/index.php?topic=63830.0
http://www.thaiseoboard.com/index.php?topic=175421.0

seemee

อ้างถึงจาก: ohmohm ใน 14 มิถุนายน 2011, 11:26:44
ดึงราคา ชื่อ ใช้ Operation ItemLookup และ  ResponseGroup Large

<?php  /* http://forums.thaisem.com/index.php?topic=8265 */
include("includes/request.php"); // http://mierendo.com/software/aws_signed_query/ aws_signed_request() in here
$public_key 'xxxxxxxxxxxxxxx';  // your public key
$private_key 'xxxxxxxxxxxxxxxx'// your private key
$tag 'YOUR_TAG_HERE-20' // your affilliate tag 
$asin 'B0000000'// your ASIN
$parsed_xml aws_signed_request('com', array('Operation'=>'ItemLookup','ItemId'=>"$asin",'ResponseGroup'=>'Large','AssociateTag'=>"$tag"), $public_key$private_key);
header('Content-type: text/xml');
print 
$parsed_xml->saveXML();


http://www.thaiseoboard.com/index.php?topic=63830.0
http://www.thaiseoboard.com/index.php?topic=175421.0

จาก Code นี้ ถ้าผมจะเอาชื่อสินค้ามาเก็บไว้ที่ ตัวแปร จะทำยังไงครับ
เท่าที่ลอง run ดูมันจะแจ้ง error ที่ header('Content-type: text/xml'); ครับ
[direct=http://bluetrustloanslogin.com]bluetrustloanslogin.com[/direct]

tatwizard


ohmohm

งั้นลบ 2 บรรทัดนี้ออก
header('Content-type: text/xml');
print $parsed_xml->saveXML();


แล้วใส่บรรทัดนี้เข้าไปแทน

echo htmlentities( $parsed_xml->Items->Item->ItemAttributes->Title, ENT_COMPAT, 'UTF-8');