2002-12-05 (Thu) [長年日記]
▲ Amazon.com Web Services 2.0
周辺がニワカにウェブサービス!ウェブサービス!とうるさいのでちょっと調べてみる。
SOAP の API だけでなくリクエストを投げると XML を返却する単純なインターフェースも用意されているようだ。
http://xml.amazon.com/onca/xml2?t=webservices-20&dev-t=[Developer Token]&AsinSearch=0439139597&type=lite&f=xml結果として以下の XML が得られる。
<?xml version="1.0" encoding="UTF-8" ?>
<ProductInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xml.amazon.com/schemas2/dev-lite.xsd">
<Details url="http://www.amazon.com/exec/obidos/redirect?tag=webservices-20%26creative=D2ADY0XSM34IZ0%26camp=2025%26link_code=xm2%26path=ASIN/0439139597">
<Asin>0439139597</Asin>
<ProductName>Harry Potter and the Goblet of Fire (Book 4)</ProductName>
<Catalog>Book</Catalog>
<Authors>
<Author>J. K. Rowling</Author>
<Author>Mary GrandPré</Author>
</Authors>
<ReleaseDate>08 July, 2000</ReleaseDate>
<Manufacturer>Scholastic Trade</Manufacturer>
<ImageUrlSmall>http://images.amazon.com/images/P/0439139597.01.THUMBZZZ.jpg</ImageUrlSmall>
<ImageUrlMedium>http://images.amazon.com/images/P/0439139597.01.MZZZZZZZ.jpg</ImageUrlMedium>
<ImageUrlLarge>http://images.amazon.com/images/P/0439139597.01.LZZZZZZZ.jpg</ImageUrlLarge>
<ListPrice>$25.95</ListPrice>
<OurPrice>$15.57</OurPrice>
<UsedPrice>$6.5</UsedPrice>
</Details>
</ProductInfo>
type に heavy を指定して、もっと詳細の結果を得ることもできる。
また、リクエストへ用意した XSL の URL を渡すことにより、Amazon 内部の XSLT プロセッサを駆動し、自由に加工した結果を得ることも可能。
http://xml.amazon.com/onca/xml2?dev-t=[developer’s token goes here]&t=webservices-20&KeywordSearch=[subject keyword goes here]&mode=[product line goes here]&type=[lite or heavy]&page=[page # goes here]&f=http://www.foo.com/bar.xslこれは SOAP なんかよりも手軽で強力かもしれない。Amazon.com の全ての機能を活用してまったく異なったデザインのサイトも、短期間でできてしまうな。 しかし、まだ日本の本は検索できないみたい。
[ツッコミを入れる]





