<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="/cms/templates/default/atom.css" type="text/css" ?>

<feed 
   xmlns="http://www.w3.org/2005/Atom"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <link href="http://www.dustinhawkins.com/cms/feeds/atom.xml" rel="self" title="" type="application/atom+xml" />
    <link href="http://dustinhawkins.com/cms/"                        rel="alternate"    title="" type="text/html" />
    <link href="http://dustinhawkins.com/cms/rss.php?version=2.0"     rel="alternate"    title="" type="application/rss+xml" />
    <title type="html"></title>
    <subtitle type="html"></subtitle>
    
    <id>http://dustinhawkins.com/cms/</id>
    <updated>2012-02-08T17:24:17Z</updated>
    <generator uri="http://www.s9y.org/" version="1.5.5">Serendipity 1.5.5 - http://www.s9y.org/</generator>
    <dc:language>en</dc:language>

    <entry>
        <link href="http://dustinhawkins.com/cms/archives/11-Amazon-Product-Advertising-API-SOAP-+-PHP-+-New-Requirements.html" rel="alternate" title="Amazon Product Advertising API - SOAP + PHP + New Requirements" />
        <author>
            <name>Dustin Hawkins</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2012-02-08T17:10:20Z</published>
        <updated>2012-02-08T17:24:17Z</updated>
        <wfw:comment>http://dustinhawkins.com/cms/wfwcomment.php?cid=11</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://dustinhawkins.com/cms/rss.php?version=atom1.0&amp;type=comments&amp;cid=11</wfw:commentRss>
    
    
        <id>http://dustinhawkins.com/cms/archives/11-guid.html</id>
        <title type="html">Amazon Product Advertising API - SOAP + PHP + New Requirements</title>
        <content type="xhtml" xml:base="http://dustinhawkins.com/cms/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>The most popular thing I've ever written was the <a href='http://dustinhawkins.com/cms/archives/3-Amazon-Web-Services-+-PHP-+-SOAP-+-Authentication.html'> SOAP+PHP+Authentication article</a> for Amazon Web Services.</p> 
<p>Sad, but true.</p> 
<p> </p> 
<p>As of November 1, 2011, Amazon changed the minimum requirements for its soap services, and in doing so, broke my example. I only know this because of a few comments on my blog post alerting me to the issue, and asking if I had a fix.&#160;</p> 
<p> </p> 
<p>Now, I do. </p> 
<p> First, they changed the structure of the request a little bit. You now have a nested parameter object, and the AssociateTag element is required.</p> 
<p> </p> 
<p> Additionally, the Signature, Timestamp, and AWS Access Key Id is now required at the SOAP header level. </p>

<div class="php geshi" style="text-align: left"><br /><br /><span style="color: #000000; font-weight: bold;">function</span> find_match <span style="color: #009900;">&#40;</span><span style="color: #000088;">$search</span><span style="color: #339933;">,</span><span style="color: #000088;">$section</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;All&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$locale</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'US'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br /><br />&#160; &#160; &#160; &#160; <span style="color: #000088;">$id</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'&lt;Your Amazon Access Key ID&gt;'</span><span style="color: #339933;">;</span><br />&#160; &#160; &#160; &#160; <span style="color: #000088;">$key</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'&lt;Your Amazon Secret Access Key&gt;'</span><span style="color: #339933;">;</span><br />&#160; &#160; &#160; &#160; <span style="color: #000088;">$wsdl</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://ecs.amazonaws.com/AWSECommerceService/2010-11-01/<span style="color: #006699; font-weight: bold;">$locale</span>/AWSECommerceService.wsdl&quot;</span><span style="color: #339933;">;</span><br />&#160; &#160; &#160; &#160; <span style="color: #000088;">$associates_tag</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;Your Amazon Associates Tag&gt;'</span><span style="color: #339933;">;</span><br />&#160;<br />&#160; &#160; &#160; &#160; <span style="color: #666666; font-style: italic;">// &#160;Create the DigSig for the AWS Call.</span><br />&#160; &#160; &#160; &#160; <span style="color: #000088;">$timeStamp</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/gmdate"><span style="color: #990000;">gmdate</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y-m-d<span style="color: #000099; font-weight: bold;">\T</span>H:i:s\Z&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />&#160; &#160; &#160; &#160; <span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ItemSearch'</span><span style="color: #339933;">.</span><span style="color: #000088;">$timeStamp</span><span style="color: #339933;">;</span><br />&#160; &#160; &#160; &#160; <span style="color: #000088;">$signature</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/base64_encode"><span style="color: #990000;">base64_encode</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/hash_hmac"><span style="color: #990000;">hash_hmac</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;sha256&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$string</span><span style="color: #339933;">,</span> <span style="color: #000088;">$key</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">True</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br /><br />&#160; &#160; &#160; &#160; <span style="color: #000088;">$client</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SoapClient<span style="color: #009900;">&#40;</span><span style="color: #000088;">$wsdl</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br /><br />&#160; &#160; &#160; &#160; <span style="color: #000088;">$headers</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #000000; font-weight: bold;">new</span> SoapHeader<span style="color: #009900;">&#40;</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">'http://security.amazonaws.com/doc/2007-01-01/'</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">'AWSAccessKeyId'</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #000088;">$id</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #000000; font-weight: bold;">new</span> SoapHeader<span style="color: #009900;">&#40;</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">'http://security.amazonaws.com/doc/2007-01-01/'</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">'Timestamp'</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #000088;">$timeStamp</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #000000; font-weight: bold;">new</span> SoapHeader<span style="color: #009900;">&#40;</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">'http://security.amazonaws.com/doc/2007-01-01/'</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">'Signature'</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #000088;">$signature</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #009900;">&#41;</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br /><br />&#160; &#160; &#160; &#160; <span style="color: #666666; font-style: italic;">//create the nested request object.</span><br /><br />&#160; &#160; &#160; &#160; <span style="color: #000088;">$params</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;AssociateTag&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$associates_tag</span><span style="color: #339933;">;</span><br />&#160; &#160; &#160; &#160; <span style="color: #000088;">$params</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;AWSAccessKeyId&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$id</span><span style="color: #339933;">;</span><br /><br />&#160; &#160; &#160; &#160; <span style="color: #000088;">$params</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Request'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a> <span style="color: #009900;">&#40;</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;Service&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;AWSECommerceService&quot;</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;Operation&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;ItemSearch&quot;</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;Keywords&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$search</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;SearchIndex&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;All&quot;</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;ResponseGroup&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;Large&quot;</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br /><br />&#160; &#160; &#160; &#160; <span style="color: #666666; font-style: italic;">//print_r($params);</span><br />&#160; &#160; &#160; &#160; <span style="color: #000088;">$client</span><span style="color: #339933;">-&gt;</span>__setSoapHeaders<span style="color: #009900;">&#40;</span><span style="color: #000088;">$headers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />&#160; &#160; &#160; &#160; <span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$client</span><span style="color: #339933;">-&gt;</span>__soapCall<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ItemSearch'</span><span style="color: #339933;">,</span><a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$params</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br /><br /><br /><br /><br /><br />&#160; &#160; &#160; &#160; <span style="color: #666666; font-style: italic;">//If its an array, we have multiple items. If its an object, its a single object.</span><br />&#160; &#160; &#160; &#160; <span style="color: #666666; font-style: italic;">//Create a slimmed down array from the reponse w/ the stuff I want in it.</span><br /><br />&#160; &#160; &#160; &#160; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/is_array"><span style="color: #990000;">is_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Items</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Items</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Item</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #000088;">$toReturn</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> &#160; <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;Image&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">MediumImage</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">URL</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;Height&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">MediumImage</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Height</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;Width&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">MediumImage</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Width</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;Detail&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">DetailPageURL</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;Title&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ItemAttributes</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Title</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;Rating&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CustomerReviews</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">AverageRating</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;Reviews&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CustomerReviews</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">TotalReviews</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;Price&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">OfferSummary</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">LowestNewPrice</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">FormattedPrice</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #009900;">&#125;</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$toReturn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />&#160; &#160; &#160; &#160; <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/is_object"><span style="color: #990000;">is_object</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Items</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #000088;">$item</span><span style="color: #339933;">=</span><span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Items</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Item</span><span style="color: #339933;">;</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #000088;">$toReturn</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> &#160; <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;Image&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">MediumImage</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">URL</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;Height&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">MediumImage</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Height</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;Width&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">MediumImage</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Width</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;Detail&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">DetailPageURL</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;Title&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ItemAttributes</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Title</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;Rating&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CustomerReviews</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">AverageRating</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;Reviews&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CustomerReviews</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">TotalReviews</span><span style="color: #339933;">,</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #0000ff;">&quot;Price&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">OfferSummary</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">LowestNewPrice</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">FormattedPrice</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #b1b100;">return</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$toReturn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />&#160; &#160; &#160; &#160; <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="color: #b1b100;">return</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />&#160; &#160; &#160; &#160; <span style="color: #009900;">&#125;</span><br /><span style="color: #009900;">&#125;</span><br /><br /><span style="color: #000000; font-weight: bold;">?&gt;</span><br />&#160;</div>
 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://dustinhawkins.com/cms/archives/9-NORMSDIST-for-the-TI-89-Calculator.html" rel="alternate" title="NORMSDIST for the TI-89 Calculator" />
        <author>
            <name>Dustin Hawkins</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2010-12-05T22:33:45Z</published>
        <updated>2010-12-06T00:29:58Z</updated>
        <wfw:comment>http://dustinhawkins.com/cms/wfwcomment.php?cid=9</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://dustinhawkins.com/cms/rss.php?version=atom1.0&amp;type=comments&amp;cid=9</wfw:commentRss>
    
    
        <id>http://dustinhawkins.com/cms/archives/9-guid.html</id>
        <title type="html">NORMSDIST for the TI-89 Calculator</title>
        <content type="xhtml" xml:base="http://dustinhawkins.com/cms/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I have an old version of the TI-89 (circa 1997), and it is conveniently missing the stats functions.&#160;</p> 
<p>The most painful of these is the Probability function P(x), which is similar to the NORMSDIST function in excel.</p> 
<p>If you want to add it to you TI-89, here is how.</p> 
<p><a href="http://support.microsoft.com/?kbid=214111">Note: this is based on Microsoft's implementation of NORMSDIST, which can be found here.</a></p> 
<p> </p> 
<p>We are going to define some functions. If you've never done this before, don't worry. Its easy.<br /><br /><br /></p> 
<p> </p> 
<p>First, we define a helper function tt(x).&#160;</p> 
<p> </p> 
<ol> 
<li>From the Home screen, Hit F4.</li> 
<li>Select &quot;Define&quot;</li> 
<li>Type this:<br /><strong>Define tt(x)=(1/(1+.2316419*x))</strong> </li> 
<li>Hit Enter. It should read 'Done'</li> 
</ol> 
<div> 
<p>Next, we define another helper function zz(x).</p> 
<ol> 
<li>From the Home screen, Hit F4</li> 
<li>Select &quot;Define&quot;</li> 
<li>Type this:<br /><strong>Define zz(x)=(1/(√(2*Π))*</strong><em style="font-weight: bold; ">e</em><strong>^(-x^2/2))&#160;</strong><br /><br />**These are the Square Root, Pi, and <em>e^ </em>symbols that are native to the TI-89. Also, its a Negative x, not Minus x.<br /><br /></li> 
<li>Hit Enter. It should read 'Done'</li> 
<p> </p> 
</ol> 
<p> </p> 
</div> 
<div> 
<p>Finally, we define the probability function prob(x). You can rename this to normsdist, but its to long for my tastes</p> 
<p> </p> 
<ol> 
<li>From the Home screen, Hit F4</li> 
<li>Select &quot;Define&quot;</li> 
<li>Type this:<br /><strong>Define prob(x)=(1-zz(x)*(0.31938153*tt(x)+ -0.356563782*(tt(x)^2)+1.781477937*(tt(x)^3)+-1.821255978*(tt(x)^4)+1.330274429*(tt(x)^5))<br /></strong><br />**These are negative numbers, not subtraction symbols, so make sure you use the proper key on the TI-89 or it will give you an error<br /><br /></li> 
<li>Hit Enter. It should read 'Done'</li> 
<p> </p> 
</ol> 
<p><u>Check you work on the TI-89</u><br /><br />To use a function just type it in like such<br /></p> 
<p><strong>tt(.625) &#160;</strong>and press Enter.<br /></p> 
<p><strong><br /></strong></p> 
</div> 
<blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 
<div> 
<p>tt(.625) = .8735</p> 
</div> 
<div> 
<p>zz(.625) = .3281</p> 
</div> 
<div> 
<p>prob(.625) = &#160;.734</p> 
</div> 
</blockquote> 
<div> 
<p> </p> 
<p><u>And in Excel:</u> </p> 
</div> 
<blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 
<p>=NORMSDIST(.625) = .734&#160;</p> 
</blockquote> 
<p> </p> 
<p>You never need to use tt(), zz(), they're just helper functions.</p> 
<p> </p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://dustinhawkins.com/cms/archives/8-Sniffing-the-Wire-HTTP-Debugging-the-easy-and-hard-way.html" rel="alternate" title="Sniffing the Wire - HTTP Debugging the easy and hard way" />
        <author>
            <name>Dustin Hawkins</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2010-09-29T21:15:10Z</published>
        <updated>2010-09-29T21:15:10Z</updated>
        <wfw:comment>http://dustinhawkins.com/cms/wfwcomment.php?cid=8</wfw:comment>
    
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://dustinhawkins.com/cms/rss.php?version=atom1.0&amp;type=comments&amp;cid=8</wfw:commentRss>
    
    
        <id>http://dustinhawkins.com/cms/archives/8-guid.html</id>
        <title type="html">Sniffing the Wire - HTTP Debugging the easy and hard way</title>
        <content type="xhtml" xml:base="http://dustinhawkins.com/cms/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>If you work in web services for any length of time, eventually you'll need to sniff the packets that are flowing and figure out what [insert framework of choice] is doing to your precious data.</p>
<p>Fear not, there is an easy way.&#160;For the sadists, there is also a hard way.</p>
<p>Read on, I'll show you both.</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p> <br /><a href="http://dustinhawkins.com/cms/archives/8-Sniffing-the-Wire-HTTP-Debugging-the-easy-and-hard-way.html#extended">Continue reading "Sniffing the Wire - HTTP Debugging the easy and hard way"</a>
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://dustinhawkins.com/cms/archives/6-Newest-Mexia-Addition.html" rel="alternate" title="Newest Mexia Addition" />
        <author>
            <name>Dustin Hawkins</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2010-04-18T00:35:27Z</published>
        <updated>2010-04-18T00:35:27Z</updated>
        <wfw:comment>http://dustinhawkins.com/cms/wfwcomment.php?cid=6</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://dustinhawkins.com/cms/rss.php?version=atom1.0&amp;type=comments&amp;cid=6</wfw:commentRss>
    
    
        <id>http://dustinhawkins.com/cms/archives/6-guid.html</id>
        <title type="html">Newest Mexia Addition</title>
        <content type="xhtml" xml:base="http://dustinhawkins.com/cms/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>Looks like our little longhorn is finally starting to live up to her name...</p>
<p> </p>
<p><img src="uploads/IMG00009-20100417-1640.jpg" /> </p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://dustinhawkins.com/cms/archives/5-Testing-Bandwith-between-two-computers-on-a-LAN.html" rel="alternate" title="Testing Bandwith between two computers on a LAN" />
        <author>
            <name>Dustin Hawkins</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2010-04-11T17:09:53Z</published>
        <updated>2010-04-11T17:09:53Z</updated>
        <wfw:comment>http://dustinhawkins.com/cms/wfwcomment.php?cid=5</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://dustinhawkins.com/cms/rss.php?version=atom1.0&amp;type=comments&amp;cid=5</wfw:commentRss>
    
    
        <id>http://dustinhawkins.com/cms/archives/5-guid.html</id>
        <title type="html">Testing Bandwith between two computers on a LAN</title>
        <content type="xhtml" xml:base="http://dustinhawkins.com/cms/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I was having some problems with the bandwidth between my Xbox360 and my Windows 7 Media Center. The connection is via a 87 foot long Cat5e cable that runs though my attic, so the stuttering and slow connection was a bit confusing. At first I thought something might have chewed through the cable, but figured I would test the bandwidth first.</p>
<p>Enter <a href="http://code.google.com/p/xjperf/" title="XJPerf">xJperf</a>, a great Java front end for <a href="http://sourceforge.net/projects/iperf/" title="IPerf">IPerf</a>&#160;that comes with a pre-compiled Win32 IPerf binary.</p>
<p>It runs in a client/server mode, so with the use of a laptop (client) and my Windows 7 Desktop (server), I was able to see that my bandwidth was in fact terrible. A new realtek driver, some cable swapping, the disabling of Windows 7 Firewall, and a reboot yielded a 4x increase in bandwidth over the link.&#160;</p>
<p>xJperf is now my second favorite network tool, behind the ever present <a href="http://www.wireshark.org/">Wireshark</a>.&#160;</p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://dustinhawkins.com/cms/archives/3-Amazon-Web-Services-+-PHP-+-SOAP-+-Authentication.html" rel="alternate" title="Amazon Web Services + PHP + SOAP + Authentication" />
        <author>
            <name>Dustin Hawkins</name>
            <email>nospam@example.com</email>
        </author>
    
        <published>2009-10-28T17:02:22Z</published>
        <updated>2009-10-28T17:02:22Z</updated>
        <wfw:comment>http://dustinhawkins.com/cms/wfwcomment.php?cid=3</wfw:comment>
    
        <slash:comments>6</slash:comments>
        <wfw:commentRss>http://dustinhawkins.com/cms/rss.php?version=atom1.0&amp;type=comments&amp;cid=3</wfw:commentRss>
    
    
        <id>http://dustinhawkins.com/cms/archives/3-guid.html</id>
        <title type="html">Amazon Web Services + PHP + SOAP + Authentication</title>
        <content type="xhtml" xml:base="http://dustinhawkins.com/cms/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I've created a couple of AWS enabled plugins for Serendipity before, but when Amazon started requiring Signed Request, I never got around to updating them. When I did, I had all kinds of hell making the standard HTTPS post work.</p> 
<p>
I decided to try my hand at converting it over to soap, which was a lot quicker and easier than I thought. I created a <a href="http://dustinhawkins.com/amazon.php" title="customized amazon search page">customized amazon search page</a> using my newfound soap skills. Keep reading to see the rest of the code.</p> <br /><a href="http://dustinhawkins.com/cms/archives/3-Amazon-Web-Services-+-PHP-+-SOAP-+-Authentication.html#extended">Continue reading "Amazon Web Services + PHP + SOAP + Authentication"</a>
            </div>
        </content>
        
    </entry>

</feed>
