Amazon ECS 3.0 shutdown AWS3.0終了

Amazon.comからメールが送られてきて
あんたのところのサイトはAmazon ECS 3.0のリクエストを
未だにしてるけど、3/31に止まるから
はやいとこAmazon Associates Web Service
(かつてAmazon E-Commerce Web Service 4.0と呼ばれていた)
に切り替えなさいよ、アナウンスは既にしてるけど。
と言う。

やれやれ困った。
このサイトのAmazon.comからの情報を得ている部分は
ほとんどAWS3.0なのだ。
こんなことを言われても困る。

Mattからのアナウンスをよく見てみると、migration guideがある。
(migrationと言えば移住というか移民というかそういうアレだ。)

しかしシステムのほとんどを色々なweb上の情報から
つぎはぎで作った自分にはさっっっぱりわからないだろうな、
と思ってみていくと、

XSLTに関しては

When using REST to access ECS 3.0, you are required to use the f parameter, which specifies either that an XML response is desired or it points to the location of an external XSLT to be applied to the response before it is returned. In ECS 3.0, even when XSLT is not being used, the f parameter is required to be set to “xml.”

In ECS 4.0, f is replaced by the Style parameter which can be used to specify the location of your XSLT file. If you are not using XSLT, this parameter is not required. If you need to set the MIME content type being returned in the response, you can set the ContentType parameter (which was the ct parameter in ECS 3.0). If no ContentType is set, the default is text/xml.

と書いてある。

ふうむ。なるほどとりあえずパラメーターが変わるわけね、
と流し読み、さらに下を見ると、
AWS3.0の時のパラメーターとAWS4.0でのパラメーターの互換表が
丁寧にも掲載されている。
ふうむ。これなら出来そうではあるな、

でやってみた。
AWS3.0でのリクエストが

http://xml-jp.amznxslt.com/onca/xml3?t=jloveandspiri-22&dev-t=D1UYR90W74B0BF&AsinSearch=4488187072&type=heavy
&locale=jp&f=http://www.j-love.info/ino/blog/AmazonXSLTe.xslt

の場合、

http://ecs.amazonaws.jp/onca/xml?Service=AWSECommerceService&SubscriptionId=0XHH583C21NNGD49S3R2&
Operation=ItemLookup&IdType=ASIN&ItemId=4488187072
&ResponseGroup=Large&AssociateTag=jloveandspiri-22&
Style=http://www.j-love.info/ino/blog/AmazonXSLTe.xslt

こうなる。変わっているのはパラメーターだけでなく、
ユーザー固有のIDも再申請が必要。 Your Access Key ID: ってやつ。

問題はxsltのテンプレートをいじらないと、
パラメーターが変わりまくっているので
スタイル情報が関連づけられていないようですというメッセージがブラウザに
表示されるか、あるいはなんかエラーが出て終わる。
まあリクエストに対して情報は帰ってきているっぽいので
明日とりあえずxsltのテンプレートをいじってみよう。

やれやれ。5日くらいかかりそうだな。

ほぼ出来きた。

ASINを入れると画像その他表示。xslについては後日記述する。

B000IDHI9A&AWSAccessKeyId=0XHH583C21NNGD49S3R2&AssociateTag=jloveandspiri-22&Operation=ItemLookup&IdType=ASIN&ContentType=text%2Fhtml&Version=2006-03-08&Page=1&ResponseGroup=ItemAttributes,Images,Offers,Reviews&Style=http://www.j-love.info/ino/blog/phpaws4.xsl”)?>
B0011XVU8G&AWSAccessKeyId=0XHH583C21NNGD49S3R2&AssociateTag=jloveandspiri-22&Operation=ItemLookup&IdType=ASIN&ContentType=text%2Fhtml&Version=2006-03-08&Page=1&ResponseGroup=ItemAttributes,Images,Offers,Reviews&Style=http://www.j-love.info/ino/blog/phpaws4.xsl”)?>
4062125366&AWSAccessKeyId=0XHH583C21NNGD49S3R2&AssociateTag=jloveandspiri-22&Operation=ItemLookup&IdType=ASIN&ContentType=text%2Fhtml&Version=2006-03-08&Page=1&ResponseGroup=ItemAttributes,Images,Offers,Reviews&Style=http://www.j-love.info/ino/blog/phpaws4.xsl”)?>
4488187072&AWSAccessKeyId=0XHH583C21NNGD49S3R2&AssociateTag=jloveandspiri-22&Operation=ItemLookup&IdType=ASIN&ContentType=text%2Fhtml&Version=2006-03-08&Page=1&ResponseGroup=ItemAttributes,Images,Offers,Reviews&Style=http://www.j-love.info/ino/blog/phpaws4.xsl”)?>
B001277MBU&AWSAccessKeyId=0XHH583C21NNGD49S3R2&AssociateTag=jloveandspiri-22&Operation=ItemLookup&IdType=ASIN&ContentType=text%2Fhtml&Version=2006-03-08&Page=1&ResponseGroup=ItemAttributes,Images,Offers,Reviews&Style=http://www.j-love.info/ino/blog/phpaws4.xsl”)?>
B000HEWJLC&AWSAccessKeyId=0XHH583C21NNGD49S3R2&AssociateTag=jloveandspiri-22&Operation=ItemLookup&IdType=ASIN&ContentType=text%2Fhtml&Version=2006-03-08&Page=1&ResponseGroup=ItemAttributes,Images,Offers,Reviews&Style=http://www.j-love.info/ino/blog/phpaws4.xsl”)?>