<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>sylvan &#187; amazon</title>
	<atom:link href="http://www.sylvan-l.net/b/tag/amazon/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sylvan-l.net/b</link>
	<description>GTD、ユーザビリティ、iPhone、本、アート</description>
	<lastBuildDate>Sat, 04 Feb 2012 17:44:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.sylvan-l.net/b/tag/amazon/feed/" />
		<item>
		<title>cakephp1.2でPEAR::Services_Amazonを使う</title>
		<link>http://www.sylvan-l.net/b/2008/01/05/cakephp12%e3%81%a7pearservices_amazon%e3%82%92%e4%bd%bf%e3%81%86/</link>
		<comments>http://www.sylvan-l.net/b/2008/01/05/cakephp12%e3%81%a7pearservices_amazon%e3%82%92%e4%bd%bf%e3%81%86/#comments</comments>
		<pubDate>Sat, 05 Jan 2008 07:40:11 +0000</pubDate>
		<dc:creator>sylvan</dc:creator>
				<category><![CDATA[その他]]></category>
		<category><![CDATA[Web開発関連]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[cakephp1.2]]></category>
		<category><![CDATA[pear]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[services_amazon]]></category>

		<guid isPermaLink="false">http://www.sylvan-l.net/b/2008/01/05/cakephp12%e3%81%a7pearservices_amazon%e3%82%92%e4%bd%bf%e3%81%86/</guid>
		<description><![CDATA[【PHP TIPS】 60. PEAR::Services_AmazonでAmazonにアクセス：ITpro PEAR :: Package :: Services_Amazon PEAR HTML_QuickForm and cakephp - Cake PHP &#124; Google グループ 上記３サイトを参考に実装する。 vendors/pear.inc.phpを作成 &#60;?php define&#40;'PEAR_PATH', dirname&#40;__FILE__&#41; . DS . 'PEAR'&#41;; set_include_path&#40;PEAR_PATH . PATH_SEPARATOR . get_include_path&#40;&#41;&#41;; ?&#62; PEAR::Services_Amazonと依存関係にあるパッケージをvendorsディレクトリ以下に配置 必要なパッケージを以下のように配置 vendors/PEAR/Cache vendors/PEAR/Cache.php vendors/PEAR/HTTP vendors/PEAR/Net vendors/PEAR/PEAR vendors/PEAR/PEAR.php vendors/PEAR/Services/Amazon.php vendors/PEAR/Services/AmazonECS4.php vendors/PEAR/XML ※もしかした不要なものも含まれてるかも。。 Services_Amazonの呼び出し キーワード「Web」で１ページ目の情報を取得 // Amazon API &#160; &#160;&#160; &#160; vendor&#40;'pear.inc'&#41;; [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://itpro.nikkeibp.co.jp/article/COLUMN/20070911/281637/">【PHP TIPS】 60. PEAR::Services_AmazonでAmazonにアクセス：ITpro</a></li>
<li><a href="http://pear.php.net/package/Services_Amazon/download">PEAR :: Package :: Services_Amazon</a></li>
<li><a href="http://groups.google.com/group/cake-php/browse_thread/thread/7bd6454b607a5ea/">PEAR HTML_QuickForm and cakephp - Cake PHP | Google グループ</a></li>
</ul>
<p>上記３サイトを参考に実装する。</p>
<ol>
<li>vendors/pear.inc.phpを作成</li>
<div class="syntax_hilite">
<div id="php-3">
<div class="php"><span style="color:#000000; font-weight:bold;">&lt;?php</span><br />
<a href="http://jp.php.net/define"><span style="color:#000066;">define</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'PEAR_PATH'</span>, <a href="http://jp.php.net/dirname"><span style="color:#000066;">dirname</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span> . DS . <span style="color:#FF0000;">'PEAR'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
<a href="http://jp.php.net/set_include_path"><span style="color:#000066;">set_include_path</span></a><span style="color:#006600; font-weight:bold;">&#40;</span>PEAR_PATH . PATH_SEPARATOR . <a href="http://jp.php.net/get_include_path"><span style="color:#000066;">get_include_path</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
<span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</div>
</div>
<p></p>
<li>PEAR::Services_Amazonと依存関係にあるパッケージをvendorsディレクトリ以下に配置</li>
<p>必要なパッケージを以下のように配置</p>
<pre><code>vendors/PEAR/Cache
vendors/PEAR/Cache.php
vendors/PEAR/HTTP
vendors/PEAR/Net
vendors/PEAR/PEAR
vendors/PEAR/PEAR.php
vendors/PEAR/Services/Amazon.php
vendors/PEAR/Services/AmazonECS4.php
vendors/PEAR/XML</code></pre>
<p>※もしかした不要なものも含まれてるかも。。</p>
<li>Services_Amazonの呼び出し</li>
<p>キーワード「Web」で１ページ目の情報を取得</p>
<div class="syntax_hilite">
<div id="php-4">
<div class="php"><span style="color:#FF9933; font-style:italic;">// Amazon API</span><br />
&nbsp; &nbsp;&nbsp; &nbsp; vendor<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'pear.inc'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp;&nbsp; &nbsp; <span style="color:#616100;">require_once</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Services/AmazonECS4.php'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp;&nbsp; &nbsp; <span style="color:#0000FF;">$option</span> = <a href="http://jp.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'subscription_id'</span> =&gt; <span style="color:#FF0000;">'xxx'</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color:#FF0000;">'associate_id'</span> =&gt; <span style="color:#FF0000;">'xxx'</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color:#FF0000;">'locale'</span> =&gt; <span style="color:#FF0000;">'JP'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp;&nbsp; &nbsp; <span style="color:#0000FF;">$amazon</span> = <span style="color:#000000; font-weight:bold;">new</span> Services_AmazonECS4<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$option</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'subscription_id'</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#0000FF;">$option</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'associate_id'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp;&nbsp; &nbsp; <span style="color:#0000FF;">$amazon</span>-&gt;<span style="color:#006600;">setLocale</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$option</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'locale'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp;&nbsp; &nbsp; <span style="color:#0000FF;">$list</span> = <span style="color:#0000FF;">$amazon</span>-&gt;<span style="color:#006600;">ItemSearch</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Books'</span>, <a href="http://jp.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Keywords'</span> =&gt; <span style="color:#FF0000;">'Web'</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#FF0000;">'ResponseGroup'</span> =&gt; <span style="color:#FF0000;">'ItemIds,ItemAttributes,Images'</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#FF0000;">'ItemPage'</span> =&gt; <span style="color:#FF0000;">'1'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;<br />
&nbsp; &nbsp;&nbsp; &nbsp; debug<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$list</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</div>
</div>
<p></ol>
<p>これで１０商品分取得できる。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sylvan-l.net/b/2008/01/05/cakephp12%e3%81%a7pearservices_amazon%e3%82%92%e4%bd%bf%e3%81%86/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.sylvan-l.net/b/2008/01/05/cakephp12%e3%81%a7pearservices_amazon%e3%82%92%e4%bd%bf%e3%81%86/" />
	</item>
	</channel>
</rss>

