<?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/"
	>

<channel>
	<title>Money-Code &#187; xml</title>
	<atom:link href="http://www.money-code.com/tag/xml/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.money-code.com</link>
	<description>Coding For Online Success</description>
	<lastBuildDate>Tue, 15 Nov 2011 18:25:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Apparel ItemSearch does not display ListPrice</title>
		<link>http://www.money-code.com/2010/01/apparel-itemsearch-does-not-display-listprice/</link>
		<comments>http://www.money-code.com/2010/01/apparel-itemsearch-does-not-display-listprice/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 17:36:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[ItemSearch]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.money-code.com/?p=598</guid>
		<description><![CDATA[Today, I was noticing one of my Amazon sites was not displaying prices for *some* apparel items. Looking closely at the XML response coming back from AWS, I noticed that ItemAttributes-&#62;ListPrice-&#62;FormattedPrice was not included as well as OfferSummary-&#62;LowestNewPrice-&#62;FormattedPrice was missing as well. Price of any sort was completely missing in about 80% of my apparel [...]


Related posts:<ol><li><a href='http://www.money-code.com/2008/01/how-to-search-amazons-catalog-with-amazons-associate-web-service/' rel='bookmark' title='How to search Amazon&#8217;s catalog with Amazon&#8217;s Associate Web Service'>How to search Amazon&#8217;s catalog with Amazon&#8217;s Associate Web Service</a></li>
<li><a href='http://www.money-code.com/2009/08/amazon-product-api-signaturedoesnotmatch-error-response/' rel='bookmark' title='Amazon Product API: SignatureDoesNotMatch error response'>Amazon Product API: SignatureDoesNotMatch error response</a></li>
<li><a href='http://www.money-code.com/2009/09/finding-browsenodes-for-amazon-api-search-aws/' rel='bookmark' title='Finding BrowseNodes for Amazon API search (AWS)'>Finding BrowseNodes for Amazon API search (AWS)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.money-code.com%2F2010%2F01%2Fapparel-itemsearch-does-not-display-listprice%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.money-code.com%2F2010%2F01%2Fapparel-itemsearch-does-not-display-listprice%2F&amp;source=hanjicode&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Today, I was noticing one of my Amazon sites was not displaying prices for *some* apparel items. Looking closely at the XML response coming back from AWS, I noticed that ItemAttributes-&gt;ListPrice-&gt;FormattedPrice was not included as well as OfferSummary-&gt;LowestNewPrice-&gt;FormattedPrice was missing as well. Price of any sort was completely missing in about 80% of my apparel listings when I do a ItemSearch.</p>
<p>After doing some Googlin&#8217; I found others with similar problems. It&#8217;s definitely not a new problem, so I was glad there were solutions, so I wanted to post this in case others run across this issue. It might be in other SearchIndexes besides apparel.</p>
<p>The solution is to modify your ResponseGroup value in your request to AWS. Normally, I only ask for &#8220;Offers, Images,ItemAttributes&#8221;. What you need to do is include &#8220;Variations&#8221; as well. So my ResponseGroup looks like: &#8220;Offers,Images,ItemAttributes,Variations&#8221;</p>
<p>You should now see VariationSummary in your XML response. To access the price there you would look at VariationSummary-&gt;LowestPrice-&gt;FormattedPrice</p>
<p>Hope this helps!</p>
<h4>Incoming search terms:</h4><ul><li>api product itemlookup price</li><li>amazon api itemsearch price</li><li>responsegroup itemattributes offers images reviews</li><li>response group for list price in amazon api</li><li>ListPrice-&gt;FormattedPrice</li><li>itemsearch amazon response number</li><li>itemsearch amazon product api price</li><li>itemattributes listprice formattedprice</li><li>itemattributes listprice</li><li>aws response groups price</li></ul><div style='clear:both'></div>

<p>Related posts:<ol><li><a href='http://www.money-code.com/2008/01/how-to-search-amazons-catalog-with-amazons-associate-web-service/' rel='bookmark' title='How to search Amazon&#8217;s catalog with Amazon&#8217;s Associate Web Service'>How to search Amazon&#8217;s catalog with Amazon&#8217;s Associate Web Service</a></li>
<li><a href='http://www.money-code.com/2009/08/amazon-product-api-signaturedoesnotmatch-error-response/' rel='bookmark' title='Amazon Product API: SignatureDoesNotMatch error response'>Amazon Product API: SignatureDoesNotMatch error response</a></li>
<li><a href='http://www.money-code.com/2009/09/finding-browsenodes-for-amazon-api-search-aws/' rel='bookmark' title='Finding BrowseNodes for Amazon API search (AWS)'>Finding BrowseNodes for Amazon API search (AWS)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.money-code.com/2010/01/apparel-itemsearch-does-not-display-listprice/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Amazon Product API: SignatureDoesNotMatch error response</title>
		<link>http://www.money-code.com/2009/08/amazon-product-api-signaturedoesnotmatch-error-response/</link>
		<comments>http://www.money-code.com/2009/08/amazon-product-api-signaturedoesnotmatch-error-response/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 04:18:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Affiliate Marketing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[store fronts]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.money-code.com/?p=536</guid>
		<description><![CDATA[On August 15, 2009, all Product Advertising API developers were required to authenticate ALL calls using a hmac/sha256 signing token. For some reason, this was a major pain in the ass for me, but I finally got things to work. If you&#8217;re having trouble, and you&#8217;re using PHP5, this may help you. The first item [...]


Related posts:<ol><li><a href='http://www.money-code.com/2009/09/finding-browsenodes-for-amazon-api-search-aws/' rel='bookmark' title='Finding BrowseNodes for Amazon API search (AWS)'>Finding BrowseNodes for Amazon API search (AWS)</a></li>
<li><a href='http://www.money-code.com/2009/08/understanding-the-amazon-product-advertising-api/' rel='bookmark' title='Understanding the Amazon Product Advertising API'>Understanding the Amazon Product Advertising API</a></li>
<li><a href='http://www.money-code.com/2008/01/how-to-search-amazons-catalog-with-amazons-associate-web-service/' rel='bookmark' title='How to search Amazon&#8217;s catalog with Amazon&#8217;s Associate Web Service'>How to search Amazon&#8217;s catalog with Amazon&#8217;s Associate Web Service</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.money-code.com%2F2009%2F08%2Famazon-product-api-signaturedoesnotmatch-error-response%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.money-code.com%2F2009%2F08%2Famazon-product-api-signaturedoesnotmatch-error-response%2F&amp;source=hanjicode&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img class="alignleft" title="Amazon Web Services" src="http://developer.amazonwebservices.com/connect/images/amazon/logo_aws.gif" alt="" width="164" height="60" />On August 15, 2009, all Product Advertising API developers were required to authenticate ALL calls using a hmac/sha256 signing token. For some reason, this was a major pain in the ass for me, but I finally got things to work.</p>
<p>If you&#8217;re having trouble, and you&#8217;re using PHP5, this may help you.</p>
<p>The first item you&#8217;ll need is the &#8216;secret&#8217;. You need to log into the Amazon Web Services area (<a href="https://developer.amazonwebservices.com" target="_blank">https://developer.amazonwebservices.com</a>). After logging in (assuming you already have a account if you&#8217;re using their API), you need to hover over &#8216;Your Account&#8217;, and click &#8216;Access Identifiers&#8217;. Here you will see &#8216;Access Key ID&#8217; and &#8216;Secret Access Key&#8217;. We&#8217;ll be referring Access Key ID as the <strong>public key</strong> and Secret Access Key as the <strong>private key</strong> in a function provided below. Copy these two values and add them to your code somewhere.</p>
<p>You will need to ensure that PHP is built with hash support. You can verify this with by view info (&lt;?phpinfo()?&gt;). If hash support is there we can use the built in <a href="http://us3.php.net/manual/en/function.hash-hmac.php" target="_blank">hash_hmac() </a>function. The concept is pretty straight forward (eventhough, I&#8217;ve been fighting it all night prior to this post). You create a string, and &#8216;hash&#8217; it with our private key, then we pass the string to Amazon&#8217;s API, and they hash the same string with our private key. The value should be the same, and if so, we&#8217;re good. If something is off any where in that sequence you&#8217;ll be getting the dreaded &#8216;<strong>SignatureDoesNotMatch</strong>&#8216; message in your XML return.</p>
<p>I came across Ulrich Mierendorff&#8217;s function for sending a signed AWS request on the developer forum, and it was the only PHP code snippet that worked for me, so I need to pass it on. Below is the function:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">function</span> aws_signed_request<span class="br0">&#40;</span><span class="re0">$region</span>, <span class="re0">$params</span>, <span class="re0">$public_key</span>, <span class="re0">$private_key</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="coMULTI">/*<br />
&nbsp; &nbsp; Copyright (c) 2009 Ulrich Mierendorff</p>
<p>&nbsp; &nbsp; Permission is hereby granted, free of charge, to any person obtaining a<br />
&nbsp; &nbsp; copy of this software and associated documentation files (the &quot;Software&quot;),<br />
&nbsp; &nbsp; to deal in the Software without restriction, including without limitation<br />
&nbsp; &nbsp; the rights to use, copy, modify, merge, publish, distribute, sublicense,<br />
&nbsp; &nbsp; and/or sell copies of the Software, and to permit persons to whom the<br />
&nbsp; &nbsp; Software is furnished to do so, subject to the following conditions:</p>
<p>&nbsp; &nbsp; The above copyright notice and this permission notice shall be included in<br />
&nbsp; &nbsp; all copies or substantial portions of the Software.</p>
<p>&nbsp; &nbsp; THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br />
&nbsp; &nbsp; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br />
&nbsp; &nbsp; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL<br />
&nbsp; &nbsp; THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br />
&nbsp; &nbsp; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING<br />
&nbsp; &nbsp; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER<br />
&nbsp; &nbsp; DEALINGS IN THE SOFTWARE.<br />
&nbsp; &nbsp; */</span></p>
<p>&nbsp; &nbsp; <span class="coMULTI">/*<br />
&nbsp; &nbsp; Parameters:<br />
&nbsp; &nbsp; &nbsp; &nbsp; $region &#8211; the Amazon(r) region (ca,com,co.uk,de,fr,jp)<br />
&nbsp; &nbsp; &nbsp; &nbsp; $params &#8211; an array of parameters, eg. array(&quot;Operation&quot;=&gt;&quot;ItemLookup&quot;,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;ItemId&quot;=&gt;&quot;B000X9FLKM&quot;, &quot;ResponseGroup&quot;=&gt;&quot;Small&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; $public_key &#8211; your &quot;Access Key ID&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $private_key &#8211; your &quot;Secret Access Key&quot;<br />
&nbsp; &nbsp; */</span></p>
<p>&nbsp; &nbsp; <span class="co1">// some paramters</span><br />
&nbsp; &nbsp; <span class="re0">$method</span> = <span class="st0">&quot;GET&quot;</span>;<br />
&nbsp; &nbsp; <span class="re0">$host</span> = <span class="st0">&quot;ecs.amazonaws.&quot;</span>.<span class="re0">$region</span>;<br />
&nbsp; &nbsp; <span class="re0">$uri</span> = <span class="st0">&quot;/onca/xml&quot;</span>;</p>
<p>&nbsp; &nbsp; <span class="co1">// additional parameters</span><br />
&nbsp; &nbsp; <span class="re0">$params</span><span class="br0">&#91;</span><span class="st0">&quot;Service&quot;</span><span class="br0">&#93;</span> = <span class="st0">&quot;AWSECommerceService&quot;</span>;<br />
&nbsp; &nbsp; <span class="re0">$params</span><span class="br0">&#91;</span><span class="st0">&quot;AWSAccessKeyId&quot;</span><span class="br0">&#93;</span> = <span class="re0">$public_key</span>;<br />
&nbsp; &nbsp; <span class="co1">// GMT timestamp</span><br />
&nbsp; &nbsp; <span class="re0">$params</span><span class="br0">&#91;</span><span class="st0">&quot;Timestamp&quot;</span><span class="br0">&#93;</span> = <a href="http://www.php.net/gmdate"><span class="kw3">gmdate</span></a><span class="br0">&#40;</span><span class="st0">&quot;Y-m-d<span class="es0">\T</span>H:i:s<span class="es0">\Z</span>&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="co1">// API version</span><br />
&nbsp; &nbsp; <span class="re0">$params</span><span class="br0">&#91;</span><span class="st0">&quot;Version&quot;</span><span class="br0">&#93;</span> = <span class="st0">&quot;2009-03-31&quot;</span>;</p>
<p>&nbsp; &nbsp; <span class="co1">// sort the parameters</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/ksort"><span class="kw3">ksort</span></a><span class="br0">&#40;</span><span class="re0">$params</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span class="co1">// create the canonicalized query</span><br />
&nbsp; &nbsp; <span class="re0">$canonicalized_query</span> = <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="kw1">foreach</span> <span class="br0">&#40;</span><span class="re0">$params</span> <span class="kw1">as</span> <span class="re0">$param</span>=&gt;<span class="re0">$value</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$param</span> = <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">&#40;</span><span class="st0">&quot;%7E&quot;</span>, <span class="st0">&quot;~&quot;</span>, <a href="http://www.php.net/rawurlencode"><span class="kw3">rawurlencode</span></a><span class="br0">&#40;</span><span class="re0">$param</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$value</span> = <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">&#40;</span><span class="st0">&quot;%7E&quot;</span>, <span class="st0">&quot;~&quot;</span>, <a href="http://www.php.net/rawurlencode"><span class="kw3">rawurlencode</span></a><span class="br0">&#40;</span><span class="re0">$value</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$canonicalized_query</span><span class="br0">&#91;</span><span class="br0">&#93;</span> = <span class="re0">$param</span>.<span class="st0">&quot;=&quot;</span>.<span class="re0">$value</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="re0">$canonicalized_query</span> = <a href="http://www.php.net/implode"><span class="kw3">implode</span></a><span class="br0">&#40;</span><span class="st0">&quot;&amp;amp;&quot;</span>, <span class="re0">$canonicalized_query</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span class="co1">// create the string to sign</span><br />
&nbsp; &nbsp; <span class="re0">$string_to_sign</span> = <span class="re0">$method</span>.<span class="st0">&quot;<span class="es0">\n</span>&quot;</span>.<span class="re0">$host</span>.<span class="st0">&quot;<span class="es0">\n</span>&quot;</span>.<span class="re0">$uri</span>.<span class="st0">&quot;<span class="es0">\n</span>&quot;</span>.<span class="re0">$canonicalized_query</span>;</p>
<p>&nbsp; &nbsp; <span class="co1">// calculate HMAC with SHA256 and base64-encoding</span><br />
&nbsp; &nbsp; <span class="re0">$signature</span> = <a href="http://www.php.net/base64_encode"><span class="kw3">base64_encode</span></a><span class="br0">&#40;</span>hash_hmac<span class="br0">&#40;</span><span class="st0">&#8216;sha256&#8242;</span>, <span class="re0">$string_to_sign</span>, <span class="re0">$private_key</span>, <span class="kw2">True</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span class="co1">// encode the signature for the request</span><br />
&nbsp; &nbsp; <span class="re0">$signature</span> = <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">&#40;</span><span class="st0">&quot;%7E&quot;</span>, <span class="st0">&quot;~&quot;</span>, <a href="http://www.php.net/rawurlencode"><span class="kw3">rawurlencode</span></a><span class="br0">&#40;</span><span class="re0">$signature</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span class="co1">// create request</span><br />
&nbsp; &nbsp; <span class="re0">$request</span> = <span class="st0">&quot;http://&quot;</span>.<span class="re0">$host</span>.<span class="re0">$uri</span>.<span class="st0">&quot;?&quot;</span>.<span class="re0">$canonicalized_query</span>.<span class="st0">&quot;&amp;amp;Signature=&quot;</span>.<span class="re0">$signature</span>;</p>
<p>&nbsp; &nbsp; <span class="co1">// do request</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$ch</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = curl_init<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; curl_setopt<span class="br0">&#40;</span><span class="re0">$ch</span>, CURLOPT_RETURNTRANSFER, <span class="nu0">1</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; curl_setopt<span class="br0">&#40;</span><span class="re0">$ch</span>, CURLOPT_URL, <span class="re0">$request</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$response</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = curl_exec<span class="br0">&#40;</span><span class="re0">$ch</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; curl_close<span class="br0">&#40;</span><span class="re0">$ch</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$response</span> === <span class="kw2">False</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">False</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// parse XML</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$pxml</span> = simplexml_load_string<span class="br0">&#40;</span><span class="re0">$response</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$pxml</span> === <span class="kw2">False</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">False</span>; <span class="co1">// no xml</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$pxml</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
<p>To call the function you create a array of arguments and pass it to the function along with the keys values.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re0">$amazontag</span>&nbsp; &nbsp; &nbsp; = <span class="st0">&#8216;asdfasfd-20&#8242;</span>;<br />
<span class="re0">$public_key</span> = <span class="st0">&quot;asfdasdfasdfasfdasfda&quot;</span>;<br />
<span class="re0">$private_key</span> = <span class="st0">&quot;SECRETKEYasfdasdfasdfasfdasfda&quot;</span>;<br />
<span class="re0">$param</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&quot;Operation&quot;</span>=&gt;<span class="st0">&quot;ItemSearch&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;IdType&quot;</span>=&gt;<span class="st0">&quot;ASIN&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;MerchantId&quot;</span>=&gt;<span class="st0">&quot;All&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;ResponseGroup&quot;</span>=&gt;<span class="st0">&quot;Large&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;SearchIndex&quot;</span>=&gt;<span class="re0">$searchindex</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;BrowseNode&quot;</span>=&gt;<span class="re0">$BrowseNode</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Keywords&quot;</span>=&gt;<span class="re0">$safeQuery</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;AWSAccessKeyId&quot;</span>=&gt;<span class="re0">$amazontag</span><span class="br0">&#41;</span>;<br />
<span class="re0">$xml</span> &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; = aws_signed_request<span class="br0">&#40;</span><span class="st0">&quot;com&quot;</span>,<span class="re0">$param</span>, <span class="re0">$public_key</span>, <span class="re0">$private_key</span><span class="br0">&#41;</span>;</div>
<p>This worked perfectly for me, and got my Amazon sites back on line. Hope this helps!!</p>
<h4>Incoming search terms:</h4><ul><li>SignatureDoesNotMatch</li><li>amazon SignatureDoesNotMatch</li><li>aws SignatureDoesNotMatch</li><li>signaturedoesnotmatch amazon</li><li>&lt;Code&gt;SignatureDoesNotMatch&lt;/Code&gt;</li><li>AWS Error Code: SignatureDoesNotMatch</li><li>amazon aws SignatureDoesNotMatch</li><li>amazon api SignatureDoesNotMatch</li><li>amazon signaturedoesnotmatch error</li><li>SignatureDoesNotMatch mws</li></ul><div style='clear:both'></div>

<p>Related posts:<ol><li><a href='http://www.money-code.com/2009/09/finding-browsenodes-for-amazon-api-search-aws/' rel='bookmark' title='Finding BrowseNodes for Amazon API search (AWS)'>Finding BrowseNodes for Amazon API search (AWS)</a></li>
<li><a href='http://www.money-code.com/2009/08/understanding-the-amazon-product-advertising-api/' rel='bookmark' title='Understanding the Amazon Product Advertising API'>Understanding the Amazon Product Advertising API</a></li>
<li><a href='http://www.money-code.com/2008/01/how-to-search-amazons-catalog-with-amazons-associate-web-service/' rel='bookmark' title='How to search Amazon&#8217;s catalog with Amazon&#8217;s Associate Web Service'>How to search Amazon&#8217;s catalog with Amazon&#8217;s Associate Web Service</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.money-code.com/2009/08/amazon-product-api-signaturedoesnotmatch-error-response/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Monitor your sites &#8211; Watch your logs</title>
		<link>http://www.money-code.com/2009/07/monitor-your-sites-watch-your-logs/</link>
		<comments>http://www.money-code.com/2009/07/monitor-your-sites-watch-your-logs/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 17:00:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[EPN]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[ebay]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.money-code.com/?p=442</guid>
		<description><![CDATA[I manage a few servers dedicated solely to my affiliate marketing efforts. As part of my daily routine, I monitor logs and activity of those servers. I do this for to maintain a level of security, but I also do this to keep an eye out for issues related to my affiliate sites. Today for [...]


Related posts:<ol><li><a href='http://www.money-code.com/2007/09/using-ebays-api-to-search-auctions-and-return-results/' rel='bookmark' title='Using eBay&#8217;s API to search auctions and return results'>Using eBay&#8217;s API to search auctions and return results</a></li>
<li><a href='http://www.money-code.com/2009/08/amazon-product-api-signaturedoesnotmatch-error-response/' rel='bookmark' title='Amazon Product API: SignatureDoesNotMatch error response'>Amazon Product API: SignatureDoesNotMatch error response</a></li>
<li><a href='http://www.money-code.com/2010/01/pay-attention-to-your-roll-your-own-epn-sites/' rel='bookmark' title='Pay Attention to your Roll-Your-Own EPN sites'>Pay Attention to your Roll-Your-Own EPN sites</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.money-code.com%2F2009%2F07%2Fmonitor-your-sites-watch-your-logs%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.money-code.com%2F2009%2F07%2Fmonitor-your-sites-watch-your-logs%2F&amp;source=hanjicode&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I manage a few servers dedicated solely to my affiliate marketing efforts. As part of my daily routine, I monitor logs and activity of those servers. I do this for to <a href="http://www.money-code.com/2009/07/thinking-about-security-for-affiliate-marketing/" target="_self">maintain a level of security</a>, but I also do this to keep an eye out for issues related to my affiliate sites.</p>
<p>Today for example, I started seeing &#8216;Warnings&#8217; about undefined variables related to a eBay API processing script. This variable is defined when the server successfully communicated with eBay&#8217;s API and it then fills a array. The array was never created, yet, there were no errors with the API communication? This was odd, so I started to do some debugging.</p>
<p>I &#8216;echoed&#8217; the response and saw the following:</p>
<div class="dean_ch" style="white-space: wrap;">object<span class="br0">&#40;</span>SimpleXMLElement<span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span><br />
&nbsp; <span class="kw2">public</span> <span class="st0">&#8216;Timestamp&#8217;</span> =&gt; string <span class="st0">&#8217;2009-07-12T15:21:46.575Z&#8217;</span> <span class="br0">&#40;</span>length=<span class="nu0">24</span><span class="br0">&#41;</span><br />
&nbsp; <span class="kw2">public</span> <span class="st0">&#8216;Ack&#8217;</span> =&gt; string <span class="st0">&#8216;Failure&#8217;</span> <span class="br0">&#40;</span>length=<span class="nu0">7</span><span class="br0">&#41;</span><br />
&nbsp; <span class="kw2">public</span> <span class="st0">&#8216;Errors&#8217;</span> =&gt;<br />
&nbsp; &nbsp; object<span class="br0">&#40;</span>SimpleXMLElement<span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw2">public</span> <span class="st0">&#8216;ShortMessage&#8217;</span> =&gt; string <span class="st0">&#8216;Auth token is hard expired.&#8217;</span> <span class="br0">&#40;</span>length=<span class="nu0">27</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw2">public</span> <span class="st0">&#8216;LongMessage&#8217;</span> =&gt; string <span class="st0">&#8216;Auth token is hard expired, User needs to generate a new token for this application.&#8217;</span> <span class="br0">&#40;</span>length=<span class="nu0">84</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw2">public</span> <span class="st0">&#8216;ErrorCode&#8217;</span> =&gt; string <span class="st0">&#8217;932&#8242;</span> <span class="br0">&#40;</span>length=<span class="nu0">3</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw2">public</span> <span class="st0">&#8216;SeverityCode&#8217;</span> =&gt; string <span class="st0">&#8216;Error&#8217;</span> <span class="br0">&#40;</span>length=<span class="nu0">5</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw2">public</span> <span class="st0">&#8216;ErrorClassification&#8217;</span> =&gt; string <span class="st0">&#8216;RequestError&#8217;</span> <span class="br0">&#40;</span>length=<span class="nu0">12</span><span class="br0">&#41;</span><br />
&nbsp; <span class="kw2">public</span> <span class="st0">&#8216;Version&#8217;</span> =&gt; string <span class="st0">&#8217;623&#8242;</span> <span class="br0">&#40;</span>length=<span class="nu0">3</span><span class="br0">&#41;</span><br />
&nbsp; <span class="kw2">public</span> <span class="st0">&#8216;Build&#8217;</span> =&gt; string <span class="st0">&#8216;e623__Bundled_9520957_R1&#8242;</span> <span class="br0">&#40;</span>length=<span class="nu0">24</span><span class="br0">&#41;</span><br />
&nbsp; <span class="kw2">public</span> <span class="st0">&#8216;HasMoreItems&#8217;</span> =&gt; string <span class="st0">&#8216;false&#8217;</span> <span class="br0">&#40;</span>length=<span class="nu0">5</span><span class="br0">&#41;</span></div>
<p>Ah, so my authToken had expired. I didn&#8217;t even know they expired. Logging into eBay&#8217;s developer area, I saw that the token expired yesterday (7/11). The bottom line, is that I have many sites communicating to eBay using the API system there, and if I didn&#8217;t monitor my logs, I would have missed this. I&#8217;ll be re-writing my API function to alert on Ack=failure to avoid this. Normally, I was just looking at &#8216;complete&#8217; failure in the communication string.</p>
<div style='clear:both'></div>

<p>Related posts:<ol><li><a href='http://www.money-code.com/2007/09/using-ebays-api-to-search-auctions-and-return-results/' rel='bookmark' title='Using eBay&#8217;s API to search auctions and return results'>Using eBay&#8217;s API to search auctions and return results</a></li>
<li><a href='http://www.money-code.com/2009/08/amazon-product-api-signaturedoesnotmatch-error-response/' rel='bookmark' title='Amazon Product API: SignatureDoesNotMatch error response'>Amazon Product API: SignatureDoesNotMatch error response</a></li>
<li><a href='http://www.money-code.com/2010/01/pay-attention-to-your-roll-your-own-epn-sites/' rel='bookmark' title='Pay Attention to your Roll-Your-Own EPN sites'>Pay Attention to your Roll-Your-Own EPN sites</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.money-code.com/2009/07/monitor-your-sites-watch-your-logs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parsing XML CJ Product Feeds</title>
		<link>http://www.money-code.com/2009/06/parsing-xml-cj-product-feeds/</link>
		<comments>http://www.money-code.com/2009/06/parsing-xml-cj-product-feeds/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 02:32:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[cj]]></category>
		<category><![CDATA[datafeed]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p>I mentioned on <a href="http://www.money-code.com/node/115">May 29th</a> that CJ allows you to create and manage product catalogs now. This is great. You can create a product feed and have it available in your FTP directory (or whatever delivery method you wish). For my personal set up, I have it stored on their server, and I need to FTP to it and grab it. I do everything via PHP on a scheduled intervals.</p>

<p>I wanted to show you how you can grab the XML data and parse it. You could use it directly or push it into a database, etc. In my situation, I want to update a local database with product items. Items will be updated every week. I won't go into the database piece (let me know if you need me to go into INSERT/DELETE SQL examples).</p>


Related posts:<ol><li><a href='http://www.money-code.com/2008/01/problems-fetching-cj-product-feeds-with-phps-ftp-functionality/' rel='bookmark' title='Problems fetching CJ Product Feeds with PHP&#8217;s FTP functionality'>Problems fetching CJ Product Feeds with PHP&#8217;s FTP functionality</a></li>
<li><a href='http://www.money-code.com/2008/10/dynamic-xmlrss-feed-using-popshops/' rel='bookmark' title='Dynamic XML/RSS Feed using PopShops'>Dynamic XML/RSS Feed using PopShops</a></li>
<li><a href='http://www.money-code.com/2007/09/simple-script-for-connecting-to-commission-junctions-product-web-service-and-populating-a-local-database/' rel='bookmark' title='Simple script for connecting to Commission Junction&#8217;s Product Web Service and populating a local database'>Simple script for connecting to Commission Junction&#8217;s Product Web Service and populating a local database</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.money-code.com%2F2009%2F06%2Fparsing-xml-cj-product-feeds%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.money-code.com%2F2009%2F06%2Fparsing-xml-cj-product-feeds%2F&amp;source=hanjicode&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I mentioned on <a href="http://www.money-code.com/node/115">May 29th</a> that CJ allows you to create and manage product catalogs now. This is great. You can create a product feed and have it available in your FTP directory (or whatever delivery method you wish). For my personal set up, I have it stored on their server, and I need to FTP to it and grab it. I do everything via PHP on a scheduled intervals.</p>
<p>I wanted to show you how you can grab the XML data and parse it. You could use it directly or push it into a database, etc. In my situation, I want to update a local database with product items. Items will be updated every week. I won&#8217;t go into the database piece (let me know if you need me to go into INSERT/DELETE SQL examples).</p>
<p>For this example, you will need PHP5 since we&#8217;ll be using the <a rel="nofollow" href="http://us.php.net/manual/en/function.simplexml-load-file.php" target="_blank">simplexml_load_file()</a> function. This is assuming that you&#8217;ve already FTP&#8217;d the XML to your working directory. Again, let me know if you need this process as well, and I can provide some examples.</p>
<p>Once we have the XML file, we pass it to the simplexml_load_file function. This function quickly parses the XML into a object. Since it&#8217;s a object, it&#8217;s snap to reference the values. My example loops through the XML object and sets local variables with the values from the XML file. You could then INSERT this values into a database or display them in real time.</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">&lt;?php</span><br />
<span class="re0">$xml</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&#8217;1111111_11111_20090528.xml&#8217;</span>;<br />
<span class="re0">$resp</span>&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = simplexml_load_file<span class="br0">&#40;</span><span class="re0">$xml</span><span class="br0">&#41;</span>;<br />
<span class="kw1">foreach</span><span class="br0">&#40;</span><span class="re0">$resp</span>-&gt;<span class="me1">product</span> <span class="kw1">as</span> <span class="re0">$item</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$name</span>&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$item</span>-&gt;<span class="me1">name</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$catalogname</span>&nbsp; &nbsp; = <span class="re0">$item</span>-&gt;<span class="me1">catalogname</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$lastupdated</span>&nbsp; &nbsp; = <span class="re0">$item</span>-&gt;<span class="me1">lastupdated</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$programurl</span>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$item</span>-&gt;<span class="me1">programurl</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$keywords</span>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$item</span>-&gt;<span class="me1">keywords</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$description</span>&nbsp; &nbsp; = <span class="re0">$item</span>-&gt;<span class="me1">description</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$sku</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$item</span>-&gt;<span class="me1">sku</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$manufacturer</span>&nbsp; &nbsp;= <span class="re0">$item</span>-&gt;<span class="me1">manufacturer</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$manufacturerid</span>&nbsp;= <span class="re0">$item</span>-&gt;<span class="me1">manufacturerid</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$upc</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$item</span>-&gt;<span class="me1">upc</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$currency</span>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$item</span>-&gt;<span class="me1">currency</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$saleprice</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$item</span>-&gt;<span class="me1">saleprice</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$price</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$item</span>-&gt;<span class="me1">price</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$retailprice</span>&nbsp; &nbsp; = <span class="re0">$item</span>-&gt;<span class="me1">retailprice</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$buyurl</span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$item</span>-&gt;<span class="me1">buyurl</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$impressionurl</span>&nbsp; = <span class="re0">$item</span>-&gt;<span class="me1">impressionurl</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$imageurl</span>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$item</span>-&gt;<span class="me1">imageurl</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$advertisercategory</span>&nbsp; &nbsp; &nbsp;= <span class="re0">$item</span>-&gt;<span class="me1">advertisercategory</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$instock</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$item</span>-&gt;<span class="me1">instock</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$condition</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$item</span>-&gt;<span class="me1">condition</span>;<br />
<span class="br0">&#125;</span><br />
<span class="kw2">?&gt;</span><br />
&nbsp;</div>
<p>My version of MySQL is 5, if you&#8217;re running 5.1 or 6, you can use a sweet MySQL command called &#8220;LOAD XML LOCAL INFILE&#8221;. For example, you could run this and it would populate your database table very quickly.</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">&lt;?php</span><br />
<span class="re0">$sql</span> = <span class="st0">&quot;LOAD XML LOCAL INFILE &#8217;1111111_11111_20090528.xml&#8217;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INTO TABLE tblProductsTest<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ROWS IDENTIFIED BY &#8216; &#8216;&quot;</span>;<br />
<span class="kw1">if</span><span class="br0">&#40;</span>!<a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="re0">$sql</span>,<span class="re0">$connect</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="st0">&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &quot;</span>.<span class="re0">$sql</span>;<br />
<span class="br0">&#125;</span><br />
<span class="kw2">?&gt;</span><br />
&nbsp;</div>
<p>I think the ability to quickly make some product feeds is awesome. Now, I just need to find time to create some new store fronts and make some cash. If you find this post useful, please follow me on <a rel="nofollow" href="https://twitter.com/hanjicode" target="_blank">Twitter</a> and Digg this post!</p>
<h4>Incoming search terms:</h4><ul><li>cj xml feed</li><li>cj rss feed</li><li>commission junction xml deal</li><li>parse commission junction xml php</li><li>cj product feed directory ftp</li><li>how to parse cj feeds</li><li>how to insert xml into sql</li><li>how to display single produc using xml feeds in php</li><li>parse xml to sql database php script</li><li>get cj feed php</li></ul><div style='clear:both'></div>

<p>Related posts:<ol><li><a href='http://www.money-code.com/2008/01/problems-fetching-cj-product-feeds-with-phps-ftp-functionality/' rel='bookmark' title='Problems fetching CJ Product Feeds with PHP&#8217;s FTP functionality'>Problems fetching CJ Product Feeds with PHP&#8217;s FTP functionality</a></li>
<li><a href='http://www.money-code.com/2008/10/dynamic-xmlrss-feed-using-popshops/' rel='bookmark' title='Dynamic XML/RSS Feed using PopShops'>Dynamic XML/RSS Feed using PopShops</a></li>
<li><a href='http://www.money-code.com/2007/09/simple-script-for-connecting-to-commission-junctions-product-web-service-and-populating-a-local-database/' rel='bookmark' title='Simple script for connecting to Commission Junction&#8217;s Product Web Service and populating a local database'>Simple script for connecting to Commission Junction&#8217;s Product Web Service and populating a local database</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.money-code.com/2009/06/parsing-xml-cj-product-feeds/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Dynamic XML/RSS Feed using PopShops</title>
		<link>http://www.money-code.com/2008/10/dynamic-xmlrss-feed-using-popshops/</link>
		<comments>http://www.money-code.com/2008/10/dynamic-xmlrss-feed-using-popshops/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 21:37:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Affiliate Marketing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[popshops]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p>Well, I noticed that I haven't added any code examples in a while, so here is a new one I'm working on now. <a href="http://www.popshops.com/" target="_blank" rel="nofollow">PopShops</a> is a great tool to display products from different merchant networks like Commission Junction, LinkShare, ShareASale, etc. You can quickly create product pages and have them delivered using multiple methods. Methods include javascript, PHP, XML, etc. </p>


Related posts:<ol><li><a href='http://www.money-code.com/2007/10/paging-ebay-rss-results/' rel='bookmark' title='Paging eBay RSS results'>Paging eBay RSS results</a></li>
<li><a href='http://www.money-code.com/2009/07/including-twitter-updates-in-your-site/' rel='bookmark' title='Including Twitter updates in your site'>Including Twitter updates in your site</a></li>
<li><a href='http://www.money-code.com/2009/06/parsing-xml-cj-product-feeds/' rel='bookmark' title='Parsing XML CJ Product Feeds'>Parsing XML CJ Product Feeds</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.money-code.com%2F2008%2F10%2Fdynamic-xmlrss-feed-using-popshops%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.money-code.com%2F2008%2F10%2Fdynamic-xmlrss-feed-using-popshops%2F&amp;source=hanjicode&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Well, I noticed that I haven&#8217;t added any code examples in a while, so here is a new one I&#8217;m working on now. <a href="http://www.popshops.com/" target="_blank" rel="nofollow">PopShops</a> is a great tool to display products from different merchant networks like Commission Junction, LinkShare, ShareASale, etc. You can quickly create product pages and have them delivered using multiple methods. Methods include javascript, PHP, XML, etc. </p>
<p>I&#8217;ve been using the Pro account for a while on a single site. With my continuing efforts to become more diversified I&#8217;ve been focusing on more PopShop stores, so I upgraded my account to the Enterprise level. This is important if you want to have unlimited affiliate PIDs, etc. Currently the free or Pro option allows for one affiliate ID / merchant. So if you have many domains listed with CJ, you can only provide one PID to track. That&#8217;s a problem, and was an obvious choice to upgrade the account. If you upgrade you also get additional features like XML/RSS options for your store.</p>
<p>With this option you can easily create dynamic XML/RSS feeds. The example below is using XML, since I wanted price and image URLs to be parsed out of the content. RSS includes these directly in the &#8216;description&#8217; and would require additional, non-needed parsing. My example is also using PHP5&#8242;s <a href="http://us.php.net/manual/en/function.simplexml-load-string.php" target="_blank" rel="nofollow">simplexml_load_string() function</a>. You will need to make sure that PHP is compiled with simplexml support for this to work. If you&#8217;re using PHP4 you&#8217;ll most likely have to use <a href="http://us.php.net/manual/en/function.domxml-open-mem.php" target="_blank" rel="nofollow">domxml_open_mem()</a> for this to work. I will not cover/support PHP4 in this post.</p>
<p>You will need to follow these instructions listed at PopShops (<a href="http://www.popshops.com/faq/affiliate-rss-xml" target="_blank">http://www.popshops.com/faq/affiliate-rss-xml</a>)</p>
<p><strong>What you will need:</strong><br />
1. A enterprise account</p>
<p><strong>How you do it:</strong><br />
1. Go ahead and create your shop the normal way by searching and adding products.<br />
2. Go to the &#8216;Pop it in&#8217; tab.<br />
3. Select the &#8216;RSS2&#8242; or the &#8216;XML&#8217; option in the code drop down.<br />
4. Copy the link to the rss version of your shop, and paste it into the address bar of your favorite browser (FireFox). It should look something like this:<br /> http://shops.popshops.com/shops/c49&#8230;59d6dc61a73.rss<br />
5. You should see an RSS/XML version of your shop.<br />
6. Now just add ?psps_search=KEYWORDS obviously replacing KEYWORDS with whatever term you are searching on. You will now have a keyword driven RSS/XML feed. So for example:<br /> http://shops.popshops.com/shops/c49&#8230;earch=ipod+case</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">&lt;?php</span><br />
<span class="kw2">function</span> send_request<span class="br0">&#40;</span><span class="re0">$rest</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/global"><span class="kw3">global</span></a> <span class="re0">$rootpath</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$ch</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = curl_init<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$timeout</span> &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; = <span class="nu0">5</span>; <span class="co1">// set to zero for no timeout</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; curl_setopt <span class="br0">&#40;</span><span class="re0">$ch</span>, CURLOPT_URL, <span class="re0">$rest</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; curl_setopt <span class="br0">&#40;</span><span class="re0">$ch</span>, CURLOPT_RETURNTRANSFER, <span class="nu0">1</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; curl_setopt <span class="br0">&#40;</span><span class="re0">$ch</span>, CURLOPT_CONNECTTIMEOUT, <span class="re0">$timeout</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$file_contents</span> &nbsp;= @curl_exec<span class="br0">&#40;</span><span class="re0">$ch</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; curl_close<span class="br0">&#40;</span><span class="re0">$ch</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$file_contents</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="re0">$count</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="kw2">false</span>;<br />
<span class="re0">$url</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&#8216;http://shops.popshops.com/shops/0snmheiasfasdeadsff_search=star+wars&#8217;</span>;<br />
<span class="re0">$rss_feed</span>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = send_request<span class="br0">&#40;</span><span class="re0">$url</span><span class="br0">&#41;</span>;<br />
<span class="kw1">if</span><span class="br0">&#40;</span><a href="http://www.php.net/strlen"><span class="kw3">strlen</span></a><span class="br0">&#40;</span><a href="http://www.php.net/trim"><span class="kw3">trim</span></a><span class="br0">&#40;</span><span class="re0">$rss_feed</span><span class="br0">&#41;</span><span class="br0">&#41;</span> &gt; <span class="nu0">0</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$resp</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = simplexml_load_string<span class="br0">&#40;</span><span class="re0">$rss_feed</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">foreach</span><span class="br0">&#40;</span><span class="re0">$resp</span>-&gt;<span class="me1">product</span> <span class="kw1">as</span> <span class="re0">$item</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$count</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="kw2">true</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="re0">$item</span>-&gt;<span class="me1">name</span>.<span class="st0">&quot;<br />
&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="re0">$item</span>-&gt;<span class="me1">price</span>.<span class="st0">&quot;<br />
&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="re0">$item</span>-&gt;<span class="me1">description</span>.<span class="st0">&quot;<br />
&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="re0">$item</span>-&gt;<span class="me1">url</span>.<span class="st0">&quot;<br />
&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="re0">$item</span>-&gt;<span class="me1">large_image_url</span>.<span class="st0">&quot;<br />
&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;</p>
<p>
&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span><br />
<span class="kw1">if</span><span class="br0">&#40;</span>!<span class="re0">$count</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&#8216;no records found&#8217;</span>;<br />
<span class="br0">&#125;</span><br />
<span class="kw2">?&gt;</span><br />
&nbsp;</div>
<h4>Incoming search terms:</h4><ul><li>popshop examples</li><li>popshops feed store</li><li>popshops review</li><li>wordpress dynamic xml feeds</li><li>wordpress with dynamic xml</li></ul><div style='clear:both'></div>

<p>Related posts:<ol><li><a href='http://www.money-code.com/2007/10/paging-ebay-rss-results/' rel='bookmark' title='Paging eBay RSS results'>Paging eBay RSS results</a></li>
<li><a href='http://www.money-code.com/2009/07/including-twitter-updates-in-your-site/' rel='bookmark' title='Including Twitter updates in your site'>Including Twitter updates in your site</a></li>
<li><a href='http://www.money-code.com/2009/06/parsing-xml-cj-product-feeds/' rel='bookmark' title='Parsing XML CJ Product Feeds'>Parsing XML CJ Product Feeds</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.money-code.com/2008/10/dynamic-xmlrss-feed-using-popshops/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to search Amazon&#8217;s catalog with Amazon&#8217;s Associate Web Service</title>
		<link>http://www.money-code.com/2008/01/how-to-search-amazons-catalog-with-amazons-associate-web-service/</link>
		<comments>http://www.money-code.com/2008/01/how-to-search-amazons-catalog-with-amazons-associate-web-service/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 21:58:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Affiliate Marketing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p>This is a small tutorial on how you can retrieve products from Amazon's Associates Web Service. I'm not the biggest fan of Amazon's affiliate program. The biggest reason is the one day cookie. I like programs that produce results, and I've always struggled with this program. When I talk to others that do have success, it definitely seems like you need a large volume of visitors, and it appears to be quite seasonally dependent.</p>

<p>Regardless, I wanted to show how you can make calls against their web service. The first step is to be a Amazon associate (<a href="https://affiliate-program.amazon.com/" target="_blank">https://affiliate-program.amazon.com/</a>). Here you will get an associate tag (usually something-20). This allows you to receive commissions by creating widgets, etc. But we want to use the AWS (Amazon Web Service), so you must be a Amazon developer. So this step will involve us going to the Amazon Web Service web site (<a href="http://aws.amazon.com" target="_blank">http://aws.amazon.com</a>). After creating account you will need to create a token. Basically, this is a password used to login to Amazon's web service. Look for a button on the upper right hand section called 'Your Web Serices Account', click on AWS Access Identifiers. Look for something down in the content called Access Key ID. You may need to generate them. To make the calls we'll need the Access Key AND your Amazon associate tag.</p>



Related posts:<ol><li><a href='http://www.money-code.com/2009/09/finding-browsenodes-for-amazon-api-search-aws/' rel='bookmark' title='Finding BrowseNodes for Amazon API search (AWS)'>Finding BrowseNodes for Amazon API search (AWS)</a></li>
<li><a href='http://www.money-code.com/2007/09/simple-script-for-connecting-to-commission-junctions-product-web-service-and-populating-a-local-database/' rel='bookmark' title='Simple script for connecting to Commission Junction&#8217;s Product Web Service and populating a local database'>Simple script for connecting to Commission Junction&#8217;s Product Web Service and populating a local database</a></li>
<li><a href='http://www.money-code.com/2009/05/amazon-associates-web-service-changes/' rel='bookmark' title='Amazon Associates Web Service Changes'>Amazon Associates Web Service Changes</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.money-code.com%2F2008%2F01%2Fhow-to-search-amazons-catalog-with-amazons-associate-web-service%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.money-code.com%2F2008%2F01%2Fhow-to-search-amazons-catalog-with-amazons-associate-web-service%2F&amp;source=hanjicode&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>This is a small tutorial on how you can retrieve products from Amazon&#8217;s Associates Web Service. I&#8217;m not the biggest fan of Amazon&#8217;s affiliate program. The biggest reason is the one day cookie. I like programs that produce results, and I&#8217;ve always struggled with this program. When I talk to others that do have success, it definitely seems like you need a large volume of visitors, and it appears to be quite seasonally dependent.</p>
<p>Regardless, I wanted to show how you can make calls against their web service. The first step is to be a Amazon associate (<a href="https://affiliate-program.amazon.com/" target="_blank">https://affiliate-program.amazon.com/</a>). Here you will get an associate tag (usually something-20). This allows you to receive commissions by creating widgets, etc. But we want to use the AWS (Amazon Web Service), so you must be a Amazon developer. So this step will involve us going to the Amazon Web Service web site (<a href="http://aws.amazon.com" target="_blank">http://aws.amazon.com</a>). After creating account you will need to create a token. Basically, this is a password used to login to Amazon&#8217;s web service. Look for a button on the upper right hand section called &#8216;Your Web Serices Account&#8217;, click on AWS Access Identifiers. Look for something down in the content called Access Key ID. You may need to generate them. To make the calls we&#8217;ll need the Access Key AND your Amazon associate tag.</p>
<p><!--break--></p>
<p>Now.. to the code.</p>
<p>The first thing we need to understand is the search index. Basically, these are the categories at Amazon. This tells the web service what category we want to search for products. If you want all products from multiple categories, use &#8216;Blended&#8217; as the search index. Here is a link that describes Amazon&#8217;s search index (<a href="http://docs.amazonwebservices.com/AWSECommerceService/2007-04-04/DG/SearchIndices.html" target="_blank">http://docs.amazonwebservices.com/AWSECommerceService/2007-04-04/DG/SearchIndices.html</a>).</p>
<p>Below is a listing of Search Indexes at Amazon:</p>
<p><code><br />
Apparel<br />
Automotive<br />
Baby<br />
Beauty<br />
Blended<br />
Books<br />
Classical<br />
DigitalMusic<br />
DVD<br />
Electronics<br />
ForeignBooks<br />
GourmetFood<br />
HealthPersonalCare<br />
Hobbies<br />
HomeGarden<br />
Jewelry<br />
Kitchen<br />
Magazines<br />
Merchants<br />
Miscellaneous<br />
Music<br />
MusicalInstruments<br />
MusicTracks<br />
OfficeProducts<br />
OutdoorLiving<br />
PCHardware<br />
PetSupplies<br />
Photo<br />
Software<br />
SoftwareVideoGames<br />
SportingGoods<br />
Tools<br />
Toys<br />
VHS<br />
Video<br />
VideoGames<br />
Wireless<br />
WirelessAccessories<br />
</code></p>
<p>Now we need to assemble a few variables for our web service call. They make it extremely easy using their REST method. We just need to assemble a querystring with our value. For this example, I want to search the &#8216;toys&#8217; index and look for Star Wars items.</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">&lt;?php</span><br />
<span class="re0">$searchIndex</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&#8216;toys&#8217;</span>;<br />
<span class="re0">$amazonAssoc</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&#8216;something-20&#8242;</span>;<br />
<span class="re0">$amazonId</span>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&#8216;SOMELONGSTRING&#8217;</span>;<br />
<span class="re0">$query</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <a href="http://www.php.net/urlencode"><span class="kw3">urlencode</span></a><span class="br0">&#40;</span><span class="st0">&#8216;star wars&#8217;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$url</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&#8216;http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&amp;amp;IdType=ASIN&amp;amp;ResponseGroup=Large&amp;amp;SearchIndex=&quot; . &nbsp;$searchIndex . &quot;&amp;amp;Operation=ItemSearch&amp;amp;Keywords=&quot; . $query . &quot;&amp;amp;AWSAccessKeyId=&quot; . $amazonId . &quot;&amp;amp;AssociateTag=&quot; . $amazonAssoc . &quot;&amp;amp;Version=2007-05-14&#8242;</span>&lt;/code&gt;<br />
<span class="kw2">?&gt;</span><br />
&nbsp;</div>
<p>After creating our querystring, we&#8217;re going to use cURL to send the request and retrieve an XML result back from the server.</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="co1">// make cURL request&lt;/code&gt;</span></p>
<p><span class="re0">$ch</span> = curl_init<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
curl_setopt<span class="br0">&#40;</span><span class="re0">$ch</span>, CURLOPT_RETURNTRANSFER, <span class="nu0">1</span><span class="br0">&#41;</span>;<br />
curl_setopt<span class="br0">&#40;</span><span class="re0">$ch</span>, CURLOPT_URL, <span class="re0">$whaturl</span><span class="br0">&#41;</span>;<br />
<span class="re0">$data</span> = curl_exec<span class="br0">&#40;</span><span class="re0">$ch</span><span class="br0">&#41;</span>;<br />
curl_close<span class="br0">&#40;</span><span class="re0">$ch</span><span class="br0">&#41;</span>;<br />
&nbsp;</div>
<p>Now we have something back from cURL. We&#8217;ll use PHP5&#8242;s ximplexml_load_string() function to create a nice XML array. From here we just simply loop through the nodes and grab values we need.</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="re0">$xml</span> &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = simplexml_load_string<span class="br0">&#40;</span><span class="re0">$data</span><span class="br0">&#41;</span>;<br />
<span class="re0">$mark</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$xml</span>-&gt;<span class="me1">TotalPages</span>;<br />
<span class="re0">$error</span> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$xml</span>-&gt;<span class="me1">ErrorMsg</span>;</p>
<p>
<span class="co1">// check to see if we have items</span><br />
<span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$xml</span>-&gt;<span class="me1">Items</span>-&gt;<span class="me1">Item</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
<span class="re0">$x</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="nu0">0</span>; <span class="co1">// set counter to handle display amounts</span><br />
<span class="kw1">foreach</span> <span class="br0">&#40;</span><span class="re0">$xml</span>-&gt;<span class="me1">Items</span>-&gt;<span class="me1">Item</span> <span class="kw1">as</span> <span class="re0">$item</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$x</span> &lt; <span class="nu0">5</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="re0">$item</span>-&gt;<span class="me1">ItemAttributes</span>-&gt;<span class="me1">Title</span>.<span class="st0">&quot;<br />
&quot;</span>;<br />
<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;Link: http://www.amazon.com/exec/obidos/asin/&quot;</span> . <span class="re0">$item</span>-&gt;<span class="me1">ASIN</span> . <span class="st0">&quot;/ref=nosim/&quot;</span> .<span class="re0">$amazontag</span>.<span class="st0">&quot;<br />
&quot;</span>;<br />
<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span><br />
<a href="http://www.php.net/unset"><span class="kw3">unset</span></a><span class="br0">&#40;</span><span class="re0">$xml</span><span class="br0">&#41;</span>;<br />
&nbsp;</div>
<p>Below is a partial structure of the XML format. I&#8217;m sure I missed something, so you might want to crack open the XML files yourself to be sure. Hope this helps!!!</p>
<pre>
ASIN
DetailPageURL
SalesRank
SmallImage
	URL
	Height
	Width
MediumImage
	URL
	Height
	Width
LargeImage
	URL
	Height
	Width
ImageSets
	MerchantId
	ImageSet
		attributes
			Category
		SwatchImage
			URL
			Height
			Width
		SmallImage
			URL
			Height
			Width
		ThumbnailImage
			URL
			Height
			Width
		TinyImage
			URL
			Height
			Width
		MediumImage
			URL
			Height
			Width
		LargeImage
			URL
			Height
			Width
ItemAttributes
	Feature
	IsAutographed
	ItemDimensions
	Label
	ListPrice
		Amount
		CurrencyCode
		FormattedPrice
	Manufacturer
	PackageDimensions
	PackageQuantity
	ProductGroup
	ProductTypeName
	Publisher
	SpecialFeatures
	Studio
	Title
OfferSummary
	LowestNewPrice
		Amount
		CurrencyCode
		FormattedPrice
	LowestUsedPrice
		Amount
		CurrencyCode
		FormattedPrice
	TotalNew
	TotalUsed
	TotalCollectible
	TotalRefurbished
Offers
	TotalOffers
	TotalOfferPages
CustomerReviews
	AverageRating
	TotalReviews
	TotalReviewPages
	Review
		ASIN
		Rating
		HelpfulVotes
		CustomerId
		Reviewer
			CustomerId
			Name
		TotalVotes
		Date
		Summary
		Content
EditorialReviews
	EditorialReview
		Source
		Content
SimilarProducts
	SimilarProduct
		ASIN
		Title
Accessories
	Accessory
		ASIN
		Title
BrowseNodes
	BrowseNode
		BrowseNodeId
		Name
		Ancestors
</pre>
<h4>Incoming search terms:</h4><ul><li>amazon searchindex</li><li>amazon catalog api</li><li>amazon catalog web service</li><li>amazon searchindex blended</li><li>catalog search amazon example delphi</li><li>amazon catalog</li><li>amazon api search in multible categories</li><li>amazon catalogue api</li><li>amazon catalog in xml</li><li>search amazon catalog</li></ul><div style='clear:both'></div>

<p>Related posts:<ol><li><a href='http://www.money-code.com/2009/09/finding-browsenodes-for-amazon-api-search-aws/' rel='bookmark' title='Finding BrowseNodes for Amazon API search (AWS)'>Finding BrowseNodes for Amazon API search (AWS)</a></li>
<li><a href='http://www.money-code.com/2007/09/simple-script-for-connecting-to-commission-junctions-product-web-service-and-populating-a-local-database/' rel='bookmark' title='Simple script for connecting to Commission Junction&#8217;s Product Web Service and populating a local database'>Simple script for connecting to Commission Junction&#8217;s Product Web Service and populating a local database</a></li>
<li><a href='http://www.money-code.com/2009/05/amazon-associates-web-service-changes/' rel='bookmark' title='Amazon Associates Web Service Changes'>Amazon Associates Web Service Changes</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.money-code.com/2008/01/how-to-search-amazons-catalog-with-amazons-associate-web-service/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CJ API/WebService version 2</title>
		<link>http://www.money-code.com/2008/01/cj-apiwebservice-version-2/</link>
		<comments>http://www.money-code.com/2008/01/cj-apiwebservice-version-2/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 17:04:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Affiliate Marketing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[cj]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[web service]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p>There was a comment a couple of days ago about CJ WebService Version 2. I did get this to work. I found some good code another programmer put together that access the v2 WSDL. Basically, this is my API test script, so you need to manually add your keywords and advertiser ID in the code, but it's a proof of concept. I think I've abandoned the CJ API. I personally think it's not that consistent. I often get 'internal server error' in the response XML. I think it might be a riskier move to go version 2 for real time calls.. just my two cents. </p>

<p>This version needs PHP5 with SOAP services built into PHP (--enable-soap). Also it's using try/catch for handling SOAP exception and it's only available in PHP5.</p>

<p>As I mentioned above, I'm pretty much ditching CJ web services all together. I still use eBay's API, but CJ's seems a little off for me. I'm doing initial tests with CJ Data Feeds now, and this really appears to be the direction I need to go.</p>


Related posts:<ol><li><a href='http://www.money-code.com/2007/10/cj-web-service-issues-unable-to-access-wsdl/' rel='bookmark' title='CJ web service issues &#8211; unable to access WSDL'>CJ web service issues &#8211; unable to access WSDL</a></li>
<li><a href='http://www.money-code.com/2007/09/simple-script-for-connecting-to-commission-junctions-product-web-service-and-populating-a-local-database/' rel='bookmark' title='Simple script for connecting to Commission Junction&#8217;s Product Web Service and populating a local database'>Simple script for connecting to Commission Junction&#8217;s Product Web Service and populating a local database</a></li>
<li><a href='http://www.money-code.com/2007/10/cj-web-service-issues-unable-to-access-wsdl-update/' rel='bookmark' title='CJ web service issues &#8211; unable to access WSDL (UPDATE)'>CJ web service issues &#8211; unable to access WSDL (UPDATE)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.money-code.com%2F2008%2F01%2Fcj-apiwebservice-version-2%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.money-code.com%2F2008%2F01%2Fcj-apiwebservice-version-2%2F&amp;source=hanjicode&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>There was a comment a couple of days ago about CJ WebService Version 2. I did get this to work. I found some good code another programmer put together that access the v2 WSDL. Basically, this is my API test script, so you need to manually add your keywords and advertiser ID in the code, but it&#8217;s a proof of concept. I think I&#8217;ve abandoned the CJ API. I personally think it&#8217;s not that consistent. I often get &#8216;internal server error&#8217; in the response XML. I think it might be a riskier move to go version 2 for real time calls.. just my two cents. </p>
<p>This version needs PHP5 with SOAP services built into PHP (&#8211;enable-soap). Also it&#8217;s using try/catch for handling SOAP exception and it&#8217;s only available in PHP5.</p>
<p>As I mentioned above, I&#8217;m pretty much ditching CJ web services all together. I still use eBay&#8217;s API, but CJ&#8217;s seems a little off for me. I&#8217;m doing initial tests with CJ Data Feeds now, and this really appears to be the direction I need to go.</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">&lt;?php</span><br />
try <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$ini</span> &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; = <a href="http://www.php.net/ini_set"><span class="kw3">ini_set</span></a><span class="br0">&#40;</span><span class="st0">&quot;soap.wsdl_cache_enabled&quot;</span>,<span class="st0">&quot;0&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$client</span> &nbsp; &nbsp; &nbsp; &nbsp; = <span class="kw2">new</span> SoapClient<span class="br0">&#40;</span><span class="st0">&#8216;productSearchServiceV2.wsdl&#8217;</span>, <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&#8216;trace&#8217;</span>=&gt; <span class="kw2">true</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$results</span> &nbsp; &nbsp; &nbsp; &nbsp;= <span class="re0">$client</span>-&gt;<span class="me1">search</span><span class="br0">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$developerKey</span> &nbsp; = <span class="st0">&#8216;yourlongdevkey&#8217;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$websiteId</span> &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&#8217;0000000&#8242;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$advertiserIds</span> &nbsp;= <span class="st0">&#8217;0000001&#8242;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$keywords</span> &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&#8216;your keywords&#8217;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$serviceableArea</span> = <span class="st0">&#8221;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$isbn</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&#8221;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$upc</span> &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&#8221;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$manufacturerName</span> = <span class="st0">&#8221;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$manufacturerSku</span> = <span class="st0">&#8221;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$advertiserSku</span> = <span class="st0">&#8221;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$lowPrice</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&#8221;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$highPrice</span> &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&#8217;50&#8242;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$lowSalePrice</span> &nbsp; = <span class="st0">&#8221;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$highSalePrice</span> &nbsp;= <span class="st0">&#8221;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$currency</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&#8221;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$sortBy</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&#8221;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$SortOrder</span> &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&#8221;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$startAt</span> &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; = <span class="nu0">0</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$maxResults</span> &nbsp; &nbsp; = <span class="nu0">100</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// DEBUG</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;&lt;h3&gt;Your search for &#8216;$keywords&#8217; generated $results-&gt;count results&lt;/h3&gt;&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">foreach</span> <span class="br0">&#40;</span><span class="re0">$results</span>-&gt;<span class="me1">products</span> <span class="kw1">as</span> <span class="re0">$product</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><a href="http://www.php.net/strlen"><span class="kw3">strlen</span></a><span class="br0">&#40;</span><a href="http://www.php.net/trim"><span class="kw3">trim</span></a><span class="br0">&#40;</span><span class="re0">$product</span>-&gt;<span class="me1">imageUrl</span><span class="br0">&#41;</span><span class="br0">&#41;</span> &gt; <span class="nu0">0</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$price</span> = <a href="http://www.php.net/sprintf"><span class="kw3">sprintf</span></a><span class="br0">&#40;</span><span class="st0">&#8216;%01.2f&#8217;</span>, <span class="re0">$product</span>-&gt;<span class="me1">price</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;&lt;br&gt;&quot;</span>.<span class="re0">$product</span>-&gt;<span class="me1">advertiserId</span>.<span class="st0">&quot;&lt;br&gt;&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;&lt;br&gt;SKU:&quot;</span>.<span class="re0">$product</span>-&gt;<span class="me1">sku</span>.<span class="st0">&quot;&lt;br&gt;&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;&lt;a href=&#8217;$product-&gt;buyUrl&#8217;&gt;&lt;img src =&#8217;$product-&gt;imageUrl&#8217; height=&#8217;70&#8242; &gt;&lt;p&gt;$product-&gt;name &lt;br/&gt; Offered by $product-&gt;advertiserName($product-&gt;advertiserId) at &lt;b&gt;$price ($product-&gt;currency)&lt;/b&gt;&lt;/p&gt;&lt;/a&gt;&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<span class="br0">&#125;</span> catch <span class="br0">&#40;</span>Exception <span class="re0">$e</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;&lt;div id=&#8217;error&#8217;&gt;&lt;p&gt;There was an error with your request or the service is unavailable.&lt;/p&gt;&lt;/div&gt;&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/print_r"><span class="kw3">print_r</span></a> <span class="br0">&#40;</span><span class="re0">$e</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span><br />
<span class="kw2">?&gt;</span><br />
&nbsp;</div>
<p>You can download productSearchServiceV2.wsdl <a href="http://www.money-code.com/files/productSearchServiceV2.wsdl" target="_blank" rel="nofollow">here.</a></p>
<p>s</p>
<h4>Incoming search terms:</h4><ul><li>CJ API example</li><li>cj php api</li><li>commission junction api script php</li><li>php cj api</li><li>commission junction php api integration code</li><li>cj php example</li><li>commission junction api php example</li><li>invalid argument supplied for foreach() in cj api</li><li>java lang classcastexception cj web services advertiser</li><li>php code cj web service</li></ul><div style='clear:both'></div>

<p>Related posts:<ol><li><a href='http://www.money-code.com/2007/10/cj-web-service-issues-unable-to-access-wsdl/' rel='bookmark' title='CJ web service issues &#8211; unable to access WSDL'>CJ web service issues &#8211; unable to access WSDL</a></li>
<li><a href='http://www.money-code.com/2007/09/simple-script-for-connecting-to-commission-junctions-product-web-service-and-populating-a-local-database/' rel='bookmark' title='Simple script for connecting to Commission Junction&#8217;s Product Web Service and populating a local database'>Simple script for connecting to Commission Junction&#8217;s Product Web Service and populating a local database</a></li>
<li><a href='http://www.money-code.com/2007/10/cj-web-service-issues-unable-to-access-wsdl-update/' rel='bookmark' title='CJ web service issues &#8211; unable to access WSDL (UPDATE)'>CJ web service issues &#8211; unable to access WSDL (UPDATE)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.money-code.com/2008/01/cj-apiwebservice-version-2/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Problems fetching CJ Product Feeds with PHP&#8217;s FTP functionality</title>
		<link>http://www.money-code.com/2008/01/problems-fetching-cj-product-feeds-with-phps-ftp-functionality/</link>
		<comments>http://www.money-code.com/2008/01/problems-fetching-cj-product-feeds-with-phps-ftp-functionality/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 16:38:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Affiliate Marketing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[cj]]></category>
		<category><![CDATA[datafeed]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p>I've been playing CJ product feeds (xml format), and came across a strange problem accessing the feed programatically using PHP's built FTP (--enable-ftp) functionality. FTPing to the site with any FTP client, even with command line FTP was no problem, but as soon as went from script the application would hang on the ftp_get() call. My firewall logs were showing lost return connections, so it almost seemed that they're rejecting traffic. I played with passive (on&#124;off) as well as format (ASCII&#124;BINARY) and the result was the same.</p>

<p>Doing a little googling I found other CJ users having the same problem with PHP and CJ Data Feeds. I think there is a FTP client flag that indicates that it's PHP and they're blocking it for security reasons. Probably to aide in stopping script spawned FTP brute force attacks?? Not sure. So, that still leaves me with a problem.. I'm unable to download the feeds with my script, but luckily there is always a million ways to skin an internet cat.</p>


Related posts:<ol><li><a href='http://www.money-code.com/2009/06/ftping-files-from-cjs-ftp-server-to-your-host/' rel='bookmark' title='FTP&#8217;ing files from CJ&#8217;s FTP server to your host'>FTP&#8217;ing files from CJ&#8217;s FTP server to your host</a></li>
<li><a href='http://www.money-code.com/2009/06/parsing-xml-cj-product-feeds/' rel='bookmark' title='Parsing XML CJ Product Feeds'>Parsing XML CJ Product Feeds</a></li>
<li><a href='http://www.money-code.com/2009/05/cj-now-allows-you-to-managecreate-product-catalogs/' rel='bookmark' title='CJ now allows you to manage/create product catalogs!'>CJ now allows you to manage/create product catalogs!</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.money-code.com%2F2008%2F01%2Fproblems-fetching-cj-product-feeds-with-phps-ftp-functionality%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.money-code.com%2F2008%2F01%2Fproblems-fetching-cj-product-feeds-with-phps-ftp-functionality%2F&amp;source=hanjicode&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I&#8217;ve been playing CJ product feeds (xml format), and came across a strange problem accessing the feed programatically using PHP&#8217;s built FTP (&#8211;enable-ftp) functionality. FTPing to the site with any FTP client, even with command line FTP was no problem, but as soon as went from script the application would hang on the ftp_get() call. My firewall logs were showing lost return connections, so it almost seemed that they&#8217;re rejecting traffic. I played with passive (on|off) as well as format (ASCII|BINARY) and the result was the same.</p>
<p>Doing a little googling I found other CJ users having the same problem with PHP and CJ Data Feeds. I think there is a FTP client flag that indicates that it&#8217;s PHP and they&#8217;re blocking it for security reasons. Probably to aide in stopping script spawned FTP brute force attacks?? Not sure. So, that still leaves me with a problem.. I&#8217;m unable to download the feeds with my script, but luckily there is always a million ways to skin an internet cat.</p>
<p>As I stated above all FTP clients were able to fetch the file, so I thought I&#8217;d try wget, and sure enough that works. I can simply call wget in my local fetch script to get it.</p>
<p>Here is a snippet in case anyone needs to know how to fetch CJ data feeds with wget.</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">&lt;?php</span><br />
<a href="http://www.php.net/exec"><span class="kw3">exec</span></a><span class="br0">&#40;</span><span class="st0">&quot;wget -P/your/local/directory/ ftp://password:username@ datatransfer.cj.com/outgoing/productcatalog/catalognumber/*.*&quot;</span><span class="br0">&#41;</span>;<br />
<span class="kw2">?&gt;</span><br />
&nbsp;</div>
<h4>Incoming search terms:</h4><ul><li>cj ftp download feeds</li><li>cj xml feed in php</li><li>download cj com feed using php</li><li>download feed from cj com using wget</li></ul><div style='clear:both'></div>

<p>Related posts:<ol><li><a href='http://www.money-code.com/2009/06/ftping-files-from-cjs-ftp-server-to-your-host/' rel='bookmark' title='FTP&#8217;ing files from CJ&#8217;s FTP server to your host'>FTP&#8217;ing files from CJ&#8217;s FTP server to your host</a></li>
<li><a href='http://www.money-code.com/2009/06/parsing-xml-cj-product-feeds/' rel='bookmark' title='Parsing XML CJ Product Feeds'>Parsing XML CJ Product Feeds</a></li>
<li><a href='http://www.money-code.com/2009/05/cj-now-allows-you-to-managecreate-product-catalogs/' rel='bookmark' title='CJ now allows you to manage/create product catalogs!'>CJ now allows you to manage/create product catalogs!</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.money-code.com/2008/01/problems-fetching-cj-product-feeds-with-phps-ftp-functionality/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paging eBay RSS results</title>
		<link>http://www.money-code.com/2007/10/paging-ebay-rss-results/</link>
		<comments>http://www.money-code.com/2007/10/paging-ebay-rss-results/#comments</comments>
		<pubDate>Thu, 04 Oct 2007 22:56:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[EPN]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[paging]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p>Here is a an extremely simple way of returning a RSS result from eBay and splitting it up into pages. Some people don't want to show 100 results, at a time, but also not be limited to show 10 results, etc. If this is the case, then paging is the key.

<p>I'll break my examples into pieces, and at the end offer the completed script so you can see it all in one piece.




Related posts:<ol><li><a href='http://www.money-code.com/2008/10/dynamic-xmlrss-feed-using-popshops/' rel='bookmark' title='Dynamic XML/RSS Feed using PopShops'>Dynamic XML/RSS Feed using PopShops</a></li>
<li><a href='http://www.money-code.com/2007/10/ebay-rss-querystringvariable-definitions/' rel='bookmark' title='eBay RSS querystring/variable definitions'>eBay RSS querystring/variable definitions</a></li>
<li><a href='http://www.money-code.com/2007/09/using-ebays-api-to-search-auctions-and-return-results/' rel='bookmark' title='Using eBay&#8217;s API to search auctions and return results'>Using eBay&#8217;s API to search auctions and return results</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.money-code.com%2F2007%2F10%2Fpaging-ebay-rss-results%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.money-code.com%2F2007%2F10%2Fpaging-ebay-rss-results%2F&amp;source=hanjicode&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Here is a an extremely simple way of returning a RSS result from eBay and splitting it up into pages. Some people don&#8217;t want to show 100 results, at a time, but also not be limited to show 10 results, etc. If this is the case, then paging is the key.</p>
<p>I&#8217;ll break my examples into pieces, and at the end offer the completed script so you can see it all in one piece.</p>
<p>First we need to create some function that will need to be used to retrieve our RSS file and parse the elements from it. There are a ton of ways to do this, and this was hobbled together from various scripts throughout the year (so sorry I can&#8217;t give credit on the some of the functions). We&#8217;ll be using cURL to sent the request and return the CML and use various callback functions to parse the XML file. I primarily work in PHP4, and what I understand this process is further simplified in PHP5. I believe that these functions will still work in 5, but please let me know if they don&#8217;t.. I need an excuse to jump to PHP5 anyway.</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">&lt;?php</span><br />
<span class="kw2">function</span> startElement<span class="br0">&#40;</span><span class="re0">$parser</span>, <span class="re0">$name</span>, <span class="re0">$attrs</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/global"><span class="kw3">global</span></a> <span class="re0">$xml_level</span>, <span class="re0">$xml_curr_path</span>, <span class="re0">$tree</span>, <span class="re0">$tree_levels</span>, <span class="re0">$grouping</span>, <span class="re0">$tag_data</span>, <span class="re0">$tag</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$xml_level</span>++;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$xml_curr_path</span> .= <span class="st0">&#8216;/&#8217;</span>.<span class="re0">$name</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$grouping</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$tag</span> &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; = <span class="kw2">true</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$xml_curr_path</span> == <span class="re0">$tree</span> &amp;&amp; <span class="re0">$xml_level</span> == <span class="re0">$tree_levels</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$grouping</span> &nbsp; &nbsp; &nbsp; = <span class="kw2">true</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$tag_data</span> &nbsp; &nbsp; &nbsp; = <span class="st0">&quot;&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw2">function</span> endElement<span class="br0">&#40;</span><span class="re0">$parser</span>, <span class="re0">$name</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/global"><span class="kw3">global</span></a> <span class="re0">$xml_level</span>, <span class="re0">$xml_curr_path</span>, <span class="re0">$tree</span>, <span class="re0">$tree_levels</span>, <span class="re0">$grouping</span>, <span class="re0">$tag_data</span>, <span class="re0">$xml_array</span>, <span class="re0">$callback_func</span>, <span class="re0">$stop_parsing</span>, <span class="re0">$tag</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$xml_level</span>&#8211;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$xml_curr_path</span> &nbsp;= <a href="http://www.php.net/substr"><span class="kw3">substr</span></a><span class="br0">&#40;</span><span class="re0">$xml_curr_path</span>,<span class="nu0">0</span>,<a href="http://www.php.net/strlen"><span class="kw3">strlen</span></a><span class="br0">&#40;</span><span class="re0">$xml_curr_path</span><span class="br0">&#41;</span> &#8211; <a href="http://www.php.net/strlen"><span class="kw3">strlen</span></a><span class="br0">&#40;</span><span class="re0">$name</span><span class="br0">&#41;</span><span class="nu0">-1</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$tag</span> &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="kw2">false</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$xml_curr_path</span> == <span class="re0">$tree</span> &amp;&amp; <span class="re0">$xml_level</span> == <span class="re0">$tree_levels</span> &amp;&amp; <span class="re0">$grouping</span> == <span class="kw2">true</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$xml_array</span><span class="br0">&#91;</span><span class="re0">$name</span><span class="br0">&#93;</span> = <span class="re0">$tag_data</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$tag</span> &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; = <span class="kw2">false</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$xml_level</span> == <span class="re0">$tree_levels</span> &#8211; <span class="nu0">1</span> &amp;&amp; <span class="re0">$grouping</span> == <span class="kw2">true</span> &amp;&amp; !<span class="re0">$stop_parsing</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$stop_parsing</span> &nbsp; = <a href="http://www.php.net/call_user_func"><span class="kw3">call_user_func</span></a><span class="br0">&#40;</span><span class="re0">$callback_func</span>, <span class="re0">$xml_array</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$grouping</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="kw2">false</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$tag</span> &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="kw2">false</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$xml_array</span> &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; = <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$tag_data</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&quot;&quot;</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="kw2">function</span> characterData<span class="br0">&#40;</span><span class="re0">$parser</span>, <span class="re0">$data</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/global"><span class="kw3">global</span></a> <span class="re0">$grouping</span>, <span class="re0">$tag_data</span>, <span class="re0">$tag</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$grouping</span> == <span class="kw2">true</span> &amp;&amp; <span class="re0">$tag</span> == <span class="kw2">true</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$tag_data</span> .= <span class="re0">$data</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw2">function</span> process_record<span class="br0">&#40;</span><span class="re0">$record</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/global"><span class="kw3">global</span></a> <span class="re0">$count</span>, <span class="re0">$resultArray</span>, <span class="re0">$cfg</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$count</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><a href="http://www.php.net/is_array"><span class="kw3">is_array</span></a><span class="br0">&#40;</span><span class="re0">$resultArray</span><span class="br0">&#41;</span> &amp;&amp; <a href="http://www.php.net/sizeof"><span class="kw3">sizeof</span></a><span class="br0">&#40;</span><span class="re0">$resultArray</span><span class="br0">&#41;</span> &gt; <span class="nu0">0</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$count</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <a href="http://www.php.net/sizeof"><span class="kw3">sizeof</span></a><span class="br0">&#40;</span><span class="re0">$resultArray</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$resultArray</span><span class="br0">&#91;</span><span class="re0">$count</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&#8216;desc&#8217;</span><span class="br0">&#93;</span> &nbsp; &nbsp;= <span class="re0">$record</span><span class="br0">&#91;</span><span class="st0">&#8216;DESCRIPTION&#8217;</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$resultArray</span><span class="br0">&#91;</span><span class="re0">$count</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&#8216;link&#8217;</span><span class="br0">&#93;</span>&nbsp; &nbsp; = <span class="re0">$record</span><span class="br0">&#91;</span><span class="st0">&#8216;LINK&#8217;</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$resultArray</span><span class="br0">&#91;</span><span class="re0">$count</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&#8216;title&#8217;</span><span class="br0">&#93;</span> &nbsp; = <span class="re0">$record</span><span class="br0">&#91;</span><span class="st0">&#8216;TITLE&#8217;</span><span class="br0">&#93;</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="kw2">function</span> convert_xml<span class="br0">&#40;</span><span class="re0">$rest</span>, <span class="re0">$callback</span>, <span class="re0">$format</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/global"><span class="kw3">global</span></a> <span class="re0">$xml_array</span>, <span class="re0">$tree</span>, <span class="re0">$tree_levels</span>, <span class="re0">$grouping</span>, <span class="re0">$tag_data</span>, <span class="re0">$callback_func</span>, <span class="re0">$stop_parsing</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$xml_array</span> &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; = <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$tree</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&#8216;/&#8217;</span>.<span class="re0">$format</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$tree_levels</span> &nbsp; &nbsp;= <a href="http://www.php.net/sizeof"><span class="kw3">sizeof</span></a><span class="br0">&#40;</span><a href="http://www.php.net/explode"><span class="kw3">explode</span></a><span class="br0">&#40;</span><span class="st0">&quot;/&quot;</span>,<span class="re0">$tree</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="nu0">-1</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$grouping</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="kw2">false</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$tag</span> &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="kw2">false</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$tag_data</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&quot;&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$callback_func</span> &nbsp;= <span class="re0">$callback</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$stop_parsing</span> &nbsp; = <span class="kw2">false</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$xml_parser</span> &nbsp; &nbsp; = <a href="http://www.php.net/xml_parser_create"><span class="kw3">xml_parser_create</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/xml_set_element_handler"><span class="kw3">xml_set_element_handler</span></a><span class="br0">&#40;</span><span class="re0">$xml_parser</span>, <span class="st0">&quot;startElement&quot;</span>, <span class="st0">&quot;endElement&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/xml_set_character_data_handler"><span class="kw3">xml_set_character_data_handler</span></a><span class="br0">&#40;</span><span class="re0">$xml_parser</span>, <span class="st0">&quot;characterData&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$ch</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = curl_init<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$timeout</span> &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; = <span class="nu0">5</span>; <span class="co1">// set to zero for no timeout</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; curl_setopt <span class="br0">&#40;</span><span class="re0">$ch</span>, CURLOPT_URL, <span class="re0">$rest</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; curl_setopt <span class="br0">&#40;</span><span class="re0">$ch</span>, CURLOPT_RETURNTRANSFER, <span class="nu0">1</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; curl_setopt <span class="br0">&#40;</span><span class="re0">$ch</span>, CURLOPT_CONNECTTIMEOUT, <span class="re0">$timeout</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$file_contents</span> &nbsp;= @curl_exec<span class="br0">&#40;</span><span class="re0">$ch</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; curl_close<span class="br0">&#40;</span><span class="re0">$ch</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/xml_parse"><span class="kw3">xml_parse</span></a><span class="br0">&#40;</span><span class="re0">$xml_parser</span>, <span class="re0">$file_contents</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;or <a href="http://www.php.net/die"><span class="kw3">die</span></a><span class="br0">&#40;</span><a href="http://www.php.net/sprintf"><span class="kw3">sprintf</span></a><span class="br0">&#40;</span><span class="st0">&quot;XML error: %s at line %d&quot;</span>, <a href="http://www.php.net/xml_error_string"><span class="kw3">xml_error_string</span></a><span class="br0">&#40;</span><a href="http://www.php.net/xml_get_error_code"><span class="kw3">xml_get_error_code</span></a><span class="br0">&#40;</span><span class="re0">$xml_parser</span><span class="br0">&#41;</span><span class="br0">&#41;</span>, <a href="http://www.php.net/xml_get_current_line_number"><span class="kw3">xml_get_current_line_number</span></a><span class="br0">&#40;</span><span class="re0">$xml_parser</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/xml_parser_free"><span class="kw3">xml_parser_free</span></a><span class="br0">&#40;</span><span class="re0">$xml_parser</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="re0">$rss</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&#8216;http://rss.api.ebay.com/ws/rssapi?FeedName=SearchResults&amp;siteId=0&amp;language=en-US&amp;output=RSS20&amp;from=R34&amp;satitle=star+wars&amp;sacat=246&#8242;</span>;<br />
<span class="re0">$count</span> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="nu0">0</span>;<br />
<span class="re0">$itemsPerPage</span>&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="nu0">10</span>;<br />
<span class="re0">$format</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&quot;RSS/CHANNEL/ITEM&quot;</span>;<br />
convert_xml<span class="br0">&#40;</span><span class="re0">$rss</span>, <span class="st0">&quot;process_record&quot;</span>, <span class="re0">$format</span><span class="br0">&#41;</span>;<br />
<span class="kw2">?&gt;</span><br />
&nbsp;</div>
<p>Here we&#8217;re passing the URL to a Star Wars RSS search result, this will sent via cURL and a XML/RSS file will be returned. Once we get to the process_record(), we&#8217;re taking the parsed values and sticking them into an associative array. This is important since we&#8217;ll be paging through the array. RSS results will return a maximum of 100 results, so we&#8217;ll be looking at them in chunks.</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">&lt;?php</span><br />
<span class="kw1">if</span><span class="br0">&#40;</span><a href="http://www.php.net/is_array"><span class="kw3">is_array</span></a><span class="br0">&#40;</span><span class="re0">$resultArray</span><span class="br0">&#41;</span> &amp;&amp; <a href="http://www.php.net/sizeof"><span class="kw3">sizeof</span></a><span class="br0">&#40;</span><span class="re0">$resultArray</span><span class="br0">&#41;</span> &gt; <span class="nu0">0</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$count</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <a href="http://www.php.net/sizeof"><span class="kw3">sizeof</span></a><span class="br0">&#40;</span><span class="re0">$resultArray</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$pages</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <a href="http://www.php.net/ceil"><span class="kw3">ceil</span></a><span class="br0">&#40;</span><span class="re0">$count</span> / <span class="re0">$itemsPerPage</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>!<a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$_GET</span><span class="br0">&#91;</span><span class="st0">&#8216;page&#8217;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$CurrentPage</span> &nbsp; &nbsp;= <span class="nu0">1</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$start</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$end</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$itemsPerPage</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="kw1">else</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$CurrentPage</span> &nbsp; &nbsp;= <span class="br0">&#40;</span><a href="http://www.php.net/is_numeric"><span class="kw3">is_numeric</span></a><span class="br0">&#40;</span><span class="re0">$_GET</span><span class="br0">&#91;</span><span class="st0">&#8216;page&#8217;</span><span class="br0">&#93;</span><span class="br0">&#41;</span> ? <span class="re0">$_GET</span><span class="br0">&#91;</span><span class="st0">&#8216;page&#8217;</span><span class="br0">&#93;</span> : <span class="nu0">1</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$CurrentPage</span> &gt; <span class="re0">$pages</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$CurrentPage</span> = <span class="nu0">1</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$start</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="br0">&#40;</span><span class="re0">$CurrentPage</span> &#8211; <span class="nu0">1</span><span class="br0">&#41;</span> * <span class="br0">&#40;</span><span class="re0">$itemsPerPage</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$end</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$start</span> + <span class="re0">$itemsPerPage</span> + <span class="nu0">1</span> ;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$end</span> &gt; <span class="re0">$count</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$end</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$count</span> &#8211; <span class="nu0">1</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span><span class="br0">&#40;</span><span class="re0">$i</span> = <span class="re0">$start</span>; <span class="re0">$i</span> &lt; <span class="re0">$end</span>; <span class="re0">$i</span>++<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;&lt;strong&gt;&lt;a href=<span class="es0">\&quot;</span>&quot;</span>.<span class="re0">$resultArray</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&#8216;link&#8217;</span><span class="br0">&#93;</span>.<span class="st0">&quot;<span class="es0">\&quot;</span>&gt;&quot;</span>.<span class="re0">$resultArray</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&#8216;title&#8217;</span><span class="br0">&#93;</span>.<span class="st0">&quot;&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="re0">$resultArray</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&#8216;desc&#8217;</span><span class="br0">&#93;</span>.<span class="st0">&quot;&lt;br&gt;&lt;br&gt;&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;Page: &quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="re0">$x</span> = <span class="nu0">1</span>; <span class="re0">$x</span> &lt;= <span class="re0">$pages</span>; <span class="re0">$x</span>++<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$CurrentPage</span> == <span class="re0">$x</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;&lt;strong&gt;&quot;</span>.<span class="re0">$x</span>.<span class="st0">&quot;&lt;/strong&gt; &quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="kw1">else</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;&lt;a href=<span class="es0">\&quot;</span>index.php?page=&quot;</span>.<span class="re0">$x</span>.<span class="st0">&quot;<span class="es0">\&quot;</span>&gt;&quot;</span>.<span class="re0">$x</span>.<span class="st0">&quot;&lt;/a&gt; &quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span><span class="kw1">else</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;no auctions found&quot;</span>;<br />
<span class="br0">&#125;</span><br />
<span class="kw2">?&gt;</span><br />
&nbsp;</div>
<p>Next we check to see if a array was returned and that it has elements in it. If it doesn&#8217;t we don&#8217;t have any results. If we do, we next calculate how many pages there are. We divide the auctions returned with the number per page we want to display. The next section is to see if we have any paging information being passed to use through the querystring. If there is a page passed, we need to verify that it&#8217;s inbound of our pages (does not exceed our maximum page). Once we have this we can calculate start and end points of the loop.</p>
<p>Finally we loop through the array using our start and end we set above. This will change as we move through the pages. And to finish it off, we need our page links at the bottom. Simply doing a for loop from 1 to the end of pages will do the trick. </p>
<p>As I said, this is fairly simple and can be adjusted to fit your needs. This example does not add your rover code, etc. Also you could do some fun stuff with preg_match instead of using the functions above to help parse even further. That&#8217;s another topic altogether. I like to pull images and item IDs out now for further customizations.</p>
<p>You can download the code <a href="../files/page.txt" rel="nofollow" target="_blank"><u>here</u></a>, just change the name to index.php to see the example work.</p>
<h4>Incoming search terms:</h4><ul><li>rss paging</li><li>paging rss results</li></ul><div style='clear:both'></div>

<p>Related posts:<ol><li><a href='http://www.money-code.com/2008/10/dynamic-xmlrss-feed-using-popshops/' rel='bookmark' title='Dynamic XML/RSS Feed using PopShops'>Dynamic XML/RSS Feed using PopShops</a></li>
<li><a href='http://www.money-code.com/2007/10/ebay-rss-querystringvariable-definitions/' rel='bookmark' title='eBay RSS querystring/variable definitions'>eBay RSS querystring/variable definitions</a></li>
<li><a href='http://www.money-code.com/2007/09/using-ebays-api-to-search-auctions-and-return-results/' rel='bookmark' title='Using eBay&#8217;s API to search auctions and return results'>Using eBay&#8217;s API to search auctions and return results</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.money-code.com/2007/10/paging-ebay-rss-results/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
