<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>The Why and The How</title>
	
	<link>http://www.thewhyandthehow.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sat, 07 Nov 2009 05:00:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<geo:lat>33.35035</geo:lat><geo:long>-111.645354</geo:long><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/TheWhyAndTheHow" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Desert Code Camp</title>
		<link>http://feedproxy.google.com/~r/TheWhyAndTheHow/~3/OJF531FCrUc/</link>
		<comments>http://www.thewhyandthehow.com/desert-code-camp/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 05:00:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[connect]]></category>
		<category><![CDATA[facebook]]></category>

		<guid isPermaLink="false">http://www.thewhyandthehow.com/?p=766</guid>
		<description><![CDATA[This is a placeholder post for now. More coming soon.
]]></description>
			<content:encoded><![CDATA[<p>This is a placeholder post for now. More coming soon.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/yurXo-iRMCGb4QiPNpHG0loMG24/0/da"><img src="http://feedads.g.doubleclick.net/~a/yurXo-iRMCGb4QiPNpHG0loMG24/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/yurXo-iRMCGb4QiPNpHG0loMG24/1/da"><img src="http://feedads.g.doubleclick.net/~a/yurXo-iRMCGb4QiPNpHG0loMG24/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=OJF531FCrUc:AxAF2VNQV48:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=OJF531FCrUc:AxAF2VNQV48:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=OJF531FCrUc:AxAF2VNQV48:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=OJF531FCrUc:AxAF2VNQV48:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=OJF531FCrUc:AxAF2VNQV48:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=OJF531FCrUc:AxAF2VNQV48:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=OJF531FCrUc:AxAF2VNQV48:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=OJF531FCrUc:AxAF2VNQV48:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheWhyAndTheHow/~4/OJF531FCrUc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.thewhyandthehow.com/desert-code-camp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.thewhyandthehow.com/desert-code-camp/</feedburner:origLink></item>
		<item>
		<title>Choose better passwords</title>
		<link>http://feedproxy.google.com/~r/TheWhyAndTheHow/~3/YiIc_5-yv0k/</link>
		<comments>http://www.thewhyandthehow.com/choose-better-passwords/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 16:49:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.thewhyandthehow.com/?p=760</guid>
		<description><![CDATA[A friend of mine recently fell victim to the Facebook 419 scam (basically someone logs into your Facebook account and asks your friends for money).
There are lots of ways bad things can happen to your computer and your online accounts, but if you use weak passwords, you&#8217;re increasing the risk that something bad will eventually [...]]]></description>
			<content:encoded><![CDATA[<p>A friend of mine recently fell victim to the <a href="http://www.facebook.com/help.php?page=797">Facebook 419 scam</a> (basically someone logs into your Facebook account and asks your friends for money).</p>
<p>There are lots of ways bad things can happen to your computer and your online accounts, but if you use weak passwords, you&#8217;re increasing the risk that something bad will eventually happen to you. There are lots of articles about what makes a <a href="http://en.wikipedia.org/wiki/Password_strength#Guidelines_for_strong_passwords">strong password</a>, but I want to tell you how to create a strong password that&#8217;s easy for you to remember. If you have to write down your strong passwords, then you probably haven&#8217;t accomplished much.</p>
<p>If you read the Wikipedia article above, you&#8217;ll see that one recommendation is that passwords should be 12-14 characters long. If you&#8217;re like most of us, creating a password of that length that includes numbers, letters and special characters can seem daunting. Let me share some tricks I&#8217;ve learned in the past decade or so that I&#8217;ve been working online.</p>
<p>First of all, passwords containing any part of your birthday or anniversary are usually a bad idea. Especially if that information is displayed in your account online (Facebook). Also passwords that contain your spouse&#8217;s name, your kids names, etc. aren&#8217;t going to be too tricky in this world of social networking.</p>
<p>So, what do you choose? My favorite method right now is using songs, poems or other text you have memorized in the course of your lifetime to create a long, but easy-to-remember password.</p>
<p>Here&#8217;s how it works.</p>
<ol>
<li>Choose your text. For the example, I&#8217;m going to use the first line of the Gettysburg address, &#8220;Four score and seven years ago our fathers brought forth, upon this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.&#8221;</li>
<li>Now reduce this to just the first 14 words as such: &#8220;Four score and seven years ago our fathers brought forth, upon this continent&#8221;</li>
<li>Now just use the first letter of each word with proper capitalization and punctuation and you suddenly have a very good password: &#8216;Fsasyaofbf,utc&#8217;.</li>
</ol>
<p>Notice that the password contains uppercase and lowercase letters and one special character, a comma. Yes, keep the comma in the password. You could also substitute the actual numbers into the text as such: &#8216;4sa7yaofbf,utc&#8217;. Now the password contains numbers, letters and special characters. If you just look at the password it appears completely random, but it&#8217;s so easy to remember.</p>
<p>The same thing applies to songs. Perhaps you&#8217;re a fan of Sean Kingston, so you choose the chorus of &#8220;Fire Burning&#8221; which is &#8220;Somebody call 911 Shawty fire burning on the dance floor&#8230;&#8221; Your new password is &#8216;Sc911Sfbotdf&#8217;.</p>
<p>If you&#8217;re a Bible reader, you have many, many ways to create complex passwords. For example you may include the scriptural reference in addition to a portion of the referenced passage. You might choose John 3:16, &#8220;For God so loved the world, that he gave his only begotten Son&#8230;&#8221; to create the password, &#8216;J3:16FGsltw,thghobS&#8217;. That one is 19 characters long, contains uppercase and lowercase letters, numbers and two special characters, but it&#8217;s amazingly simple to remember.</p>
<p>Using this technique, you can also create a set of strong passwords that you can use on different sites. Perhaps you associate the first letter of the site name with an author, scripture or recording artist/song. Twitter then becomes related to Thoreau or Thessalonians or Til Tuesday, while Facebook is related to Faulkner or First Timothy or Fatboy Slim.  </p>
<p>My best recommendation is to start right away with at least one strong password. Get rid of your 4-6 character passwords. Get rid of your birthday or name-based passwords. Pick something that you&#8217;ve already memorized and make a password that really works.</p>
<p><strong>Last note</strong>: Unfortunately not all web sites allow you to be completely creative with your passwords. Some sites don&#8217;t allow special characters. Other&#8217;s set limits on the length of a password. Hopefully that will change soon, but until then, you might have to tweak some of your choice to fit some of the sites you use. Don&#8217;t let that discourage you from using better passwords on the sites that allow it.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/JMsRsMG64DdjD8shKxetihlIgUg/0/da"><img src="http://feedads.g.doubleclick.net/~a/JMsRsMG64DdjD8shKxetihlIgUg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/JMsRsMG64DdjD8shKxetihlIgUg/1/da"><img src="http://feedads.g.doubleclick.net/~a/JMsRsMG64DdjD8shKxetihlIgUg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=YiIc_5-yv0k:Ung-K8mMEL4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=YiIc_5-yv0k:Ung-K8mMEL4:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=YiIc_5-yv0k:Ung-K8mMEL4:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=YiIc_5-yv0k:Ung-K8mMEL4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=YiIc_5-yv0k:Ung-K8mMEL4:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=YiIc_5-yv0k:Ung-K8mMEL4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=YiIc_5-yv0k:Ung-K8mMEL4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=YiIc_5-yv0k:Ung-K8mMEL4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheWhyAndTheHow/~4/YiIc_5-yv0k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.thewhyandthehow.com/choose-better-passwords/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.thewhyandthehow.com/choose-better-passwords/</feedburner:origLink></item>
		<item>
		<title>Signing AWS requests in PHP</title>
		<link>http://feedproxy.google.com/~r/TheWhyAndTheHow/~3/RXITacXS4SY/</link>
		<comments>http://www.thewhyandthehow.com/signing-aws-requests-in-php/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 22:58:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.thewhyandthehow.com/?p=750</guid>
		<description><![CDATA[Recently Amazon added the requirement that all requests must be signed. The process of signing requests is documented on this product advertising API page. Based on the steps listed there, and with a lot of help from @giltotherescue, I was able to create a PHP function to create a signed request URI based on a [...]]]></description>
			<content:encoded><![CDATA[<p>Recently Amazon added the requirement that all requests must be signed. The process of signing requests is documented on this <a href="http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?rest-signature.html">product advertising API</a> page. Based on the steps listed there, and with a lot of help from <a href="http://twitter.com/giltotherescue">@giltotherescue</a>, I was able to create a PHP function to create a signed request URI based on a simple set of request parameters.</p>

<div id="wp_codebox_msgheader"><span class="right"><a href="javascript:;" onclick="toggle_collapse('p7504');">[<span id="p7504_symbol">-</span>]</a><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p750code4'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div id="wp_codebox"><table width="100%" ><tr id="p7504"><td class="code" id="p750code4"><pre class="php"><span style="color: #000000; font-weight: bold;">function</span> makeAWSUrl<span style="color: #009900;">&#40;</span><span style="color: #000033;">$parameters</span><span style="color: #339933;">,</span> <span style="color: #000033;">$associate_tag</span><span style="color: #339933;">,</span> <span style="color: #000033;">$access_key</span><span style="color: #339933;">,</span> <span style="color: #000033;">$secret_key</span><span style="color: #339933;">,</span> <span style="color: #000033;">$aws_version</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'2009-06-01'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000033;">$host</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ecs.amazonaws.com'</span><span style="color: #339933;">;</span>
  <span style="color: #000033;">$path</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/onca/xml'</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000033;">$query</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: #0000ff;">'Service'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'AWSECommerceService'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'AWSAccessKeyId'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000033;">$access_key</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'AssociateTag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000033;">$associate_tag</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'Timestamp'</span> <span style="color: #339933;">=&gt;</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;">'Y-m-d<span style="color: #000099; font-weight: bold;">\T</span>H:i:s<span style="color: #000099; font-weight: bold;">\Z</span>'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'Version'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000033;">$aws_version</span><span style="color: #339933;">,</span>
  <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Merge in any options that were passed in</span>
  <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: #000033;">$parameters</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000033;">$query</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array_merge"><span style="color: #990000;">array_merge</span></a><span style="color: #009900;">&#40;</span><span style="color: #000033;">$query</span><span style="color: #339933;">,</span> <span style="color: #000033;">$parameters</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Do a case-insensitive, natural order sort on the array keys.</span>
  <a href="http://www.php.net/ksort"><span style="color: #990000;">ksort</span></a><span style="color: #009900;">&#40;</span><span style="color: #000033;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// create the signable string</span>
  <span style="color: #000033;">$temp</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: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000033;">$query</span> <span style="color: #b1b100;">as</span> <span style="color: #000033;">$k</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000033;">$v</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000033;">$temp</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%7E'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'~'</span><span style="color: #339933;">,</span> <a href="http://www.php.net/rawurlencode"><span style="color: #990000;">rawurlencode</span></a><span style="color: #009900;">&#40;</span><span style="color: #000033;">$k</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'='</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%7E'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'~'</span><span style="color: #339933;">,</span> <a href="http://www.php.net/rawurlencode"><span style="color: #990000;">rawurlencode</span></a><span style="color: #009900;">&#40;</span><span style="color: #000033;">$v</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000033;">$signable</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/implode"><span style="color: #990000;">implode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&amp;'</span><span style="color: #339933;">,</span> <span style="color: #000033;">$temp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000033;">$stringToSign</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;GET<span style="color: #000099; font-weight: bold;">\n</span>$host<span style="color: #000099; font-weight: bold;">\n</span>$path<span style="color: #000099; font-weight: bold;">\n</span>$signable&quot;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Hash the AWS secret key and generate a signature for the request.</span>
  <span style="color: #000033;">$hex_str</span> <span style="color: #339933;">=</span> hash_hmac<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sha256'</span><span style="color: #339933;">,</span> <span style="color: #000033;">$stringToSign</span><span style="color: #339933;">,</span> <span style="color: #000033;">$secret_key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000033;">$raw</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000033;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000033;">$i</span> <span style="color: #339933;">&lt;</span> <a href="http://www.php.net/strlen"><span style="color: #990000;">strlen</span></a><span style="color: #009900;">&#40;</span><span style="color: #000033;">$hex_str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000033;">$i</span> <span style="color: #339933;">+=</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000033;">$raw</span> <span style="color: #339933;">.=</span> <a href="http://www.php.net/chr"><span style="color: #990000;">chr</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/hexdec"><span style="color: #990000;">hexdec</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000033;">$hex_str</span><span style="color: #339933;">,</span> <span style="color: #000033;">$i</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000033;">$query</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Signature'</span><span style="color: #009900;">&#93;</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><span style="color: #000033;">$raw</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <a href="http://www.php.net/ksort"><span style="color: #990000;">ksort</span></a><span style="color: #009900;">&#40;</span><span style="color: #000033;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000033;">$temp</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: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000033;">$query</span> <span style="color: #b1b100;">as</span> <span style="color: #000033;">$k</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000033;">$v</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000033;">$temp</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/rawurlencode"><span style="color: #990000;">rawurlencode</span></a><span style="color: #009900;">&#40;</span><span style="color: #000033;">$k</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'='</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/rawurlencode"><span style="color: #990000;">rawurlencode</span></a><span style="color: #009900;">&#40;</span><span style="color: #000033;">$v</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000033;">$final</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/implode"><span style="color: #990000;">implode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&amp;'</span><span style="color: #339933;">,</span> <span style="color: #000033;">$temp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'http://'</span> <span style="color: #339933;">.</span> <span style="color: #000033;">$host</span> <span style="color: #339933;">.</span> <span style="color: #000033;">$path</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'?'</span> <span style="color: #339933;">.</span> <span style="color: #000033;">$final</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Using the function is simple. The first parameter is a PHP array of AWS parameters, the others are standard associate tags and keys. Here&#8217;s an example:</p>

<div id="wp_codebox_msgheader"><span class="right"><a href="javascript:;" onclick="toggle_collapse('p7505');">[<span id="p7505_symbol">-</span>]</a><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p750code5'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div id="wp_codebox"><table width="100%" ><tr id="p7505"><td class="code" id="p750code5"><pre class="php"><span style="color: #000033;">$url</span> <span style="color: #339933;">=</span> makeAWSUrl<span style="color: #009900;">&#40;</span><a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Keywords'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Jaco Pastorius'</span><span style="color: #339933;">,</span>                           
                      <span style="color: #0000ff;">'Operation'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'ItemSearch'</span><span style="color: #339933;">,</span>                          
                      <span style="color: #0000ff;">'ResponseGroup'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Medium'</span><span style="color: #339933;">,</span>                           
                      <span style="color: #0000ff;">'SearchIndex'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Music'</span><span style="color: #339933;">,</span>                           
                      <span style="color: #0000ff;">'salesrank'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Bestselling'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>  
  <span style="color: #0000ff;">'YOUR_ASSOC_TAG'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'YOUR_ACCESS_KEY'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'YOUR_SECRET_KEY'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>The result of the above call (using my tags and keys) is:</p>

<div id="wp_codebox_msgheader"><span class="right"><a href="javascript:;" onclick="toggle_collapse('p7506');">[<span id="p7506_symbol">-</span>]</a><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p750code6'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div id="wp_codebox"><table width="100%" ><tr id="p7506"><td class="code" id="p750code6"><pre class="php">http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//ecs.amazonaws.com/onca/xml?AWSAccessKeyId=[MYKEY]&amp;AssociateTag=blakesblogand-20&amp;Keywords=Jaco%20Pastorius&amp;Operation=ItemSearch&amp;ResponseGroup=Medium&amp;SearchIndex=Music&amp;Service=AWSECommerceService&amp;Signature=qZ%2BheDqfZi79b2Xg0JSP2kgG2FgQn823GLn0m1sVmnM%3D&amp;Timestamp=2009-08-19T22%3A53%3A29Z&amp;Version=2009-06-01&amp;salesrank=Bestselling</span></pre></td></tr></table></div>

<p>As always, give me some feedback, take the code and make it better. Share it and include it in your libraries &#8230; have fun!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/G2M1hWR1AIu5YfrzycH--ERE0YU/0/da"><img src="http://feedads.g.doubleclick.net/~a/G2M1hWR1AIu5YfrzycH--ERE0YU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/G2M1hWR1AIu5YfrzycH--ERE0YU/1/da"><img src="http://feedads.g.doubleclick.net/~a/G2M1hWR1AIu5YfrzycH--ERE0YU/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=RXITacXS4SY:HArEm8XFhW0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=RXITacXS4SY:HArEm8XFhW0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=RXITacXS4SY:HArEm8XFhW0:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=RXITacXS4SY:HArEm8XFhW0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=RXITacXS4SY:HArEm8XFhW0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=RXITacXS4SY:HArEm8XFhW0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=RXITacXS4SY:HArEm8XFhW0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=RXITacXS4SY:HArEm8XFhW0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheWhyAndTheHow/~4/RXITacXS4SY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.thewhyandthehow.com/signing-aws-requests-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.thewhyandthehow.com/signing-aws-requests-in-php/</feedburner:origLink></item>
		<item>
		<title>SCP for Komodo IDE</title>
		<link>http://feedproxy.google.com/~r/TheWhyAndTheHow/~3/BL1RkaHMe-I/</link>
		<comments>http://www.thewhyandthehow.com/scp-for-komodo-ide/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 00:15:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.thewhyandthehow.com/?p=746</guid>
		<description><![CDATA[I have just finished developing my first Komodo IDE plugin. I love Komodo. It&#8217;s the first IDE for PHP that I&#8217;ve been very, very happy using. I&#8217;ve run it on Windows, Linux and now on a MacBook. The only frustration I&#8217;ve had is that Komodo doesn&#8217;t support basic integrated file uploading via SCP. While it [...]]]></description>
			<content:encoded><![CDATA[<p>I have just finished developing my first <a href="http://www.activestate.com/komodo/">Komodo IDE</a> plugin. I love Komodo. It&#8217;s the first IDE for PHP that I&#8217;ve been very, very happy using. I&#8217;ve run it on Windows, Linux and now on a MacBook. The only frustration I&#8217;ve had is that Komodo doesn&#8217;t support basic integrated file uploading via SCP. While it is possible to save a file remotely, there is no simple way to save a file locally and upload it to a mapped location on a remote server from within the IDE.</p>
<p>Fortunately Komodo also provides a simple method for creating extensions within the IDE itself, so I gave it a try. Within a few hours I was able to build an extension to do exactly what I needed and configure it on a per-project basis. I&#8217;ve made the extension available as an <a href="http://code.google.com/p/scp-for-komodo-ide/">MIT-licensed, open-source project</a>. As always, this project is included on the <a href="http://www.thewhyandthehow.com/open-source-tools/">open source tools page</a>.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/syrGogbbbH4qUI1bnMGQtjiQUBI/0/da"><img src="http://feedads.g.doubleclick.net/~a/syrGogbbbH4qUI1bnMGQtjiQUBI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/syrGogbbbH4qUI1bnMGQtjiQUBI/1/da"><img src="http://feedads.g.doubleclick.net/~a/syrGogbbbH4qUI1bnMGQtjiQUBI/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=BL1RkaHMe-I:p8W6kmyw7M0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=BL1RkaHMe-I:p8W6kmyw7M0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=BL1RkaHMe-I:p8W6kmyw7M0:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=BL1RkaHMe-I:p8W6kmyw7M0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=BL1RkaHMe-I:p8W6kmyw7M0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=BL1RkaHMe-I:p8W6kmyw7M0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=BL1RkaHMe-I:p8W6kmyw7M0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=BL1RkaHMe-I:p8W6kmyw7M0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheWhyAndTheHow/~4/BL1RkaHMe-I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.thewhyandthehow.com/scp-for-komodo-ide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.thewhyandthehow.com/scp-for-komodo-ide/</feedburner:origLink></item>
		<item>
		<title>Facebook Connect comments as WordPress plugin</title>
		<link>http://feedproxy.google.com/~r/TheWhyAndTheHow/~3/U9z32741ONo/</link>
		<comments>http://www.thewhyandthehow.com/facebook-connect-comments-as-wordpress-plugin/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 15:48:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.thewhyandthehow.com/?p=741</guid>
		<description><![CDATA[My article Integrating Facebook Connect using the Thesis theme has generated a great deal of interest and several requests for a WordPress plugin. I personally haven&#8217;t had the time or inclination to create a plugin, but my friend and colleague Aaron Collegeman has. He was interested in the concept for one of his projects and [...]]]></description>
			<content:encoded><![CDATA[<p>My article <a href="http://www.thewhyandthehow.com/integrating-facebook-connect-using-the-thesis-theme/">Integrating Facebook Connect using the Thesis theme</a> has generated a great deal of interest and several requests for a WordPress plugin. I personally haven&#8217;t had the time or inclination to create a plugin, but my friend and colleague <a href="http://aaroncollegeman.com/">Aaron Collegeman</a> has. He was interested in the concept for one of his projects and asked permission to use my code.</p>
<p>Yesterday he released the <a href="http://code.google.com/p/wpfb/">plugin as an open source project</a>. I haven&#8217;t had a chance to install the plugin, but having worked with Aaron in the past, I&#8217;m sure it&#8217;s top notch. I looked at the source code and really like the way he developed the integration with WordPress.</p>
<p>If you&#8217;re interested in adding Facebook comments to your WordPress blog, I suggest you give Aaron&#8217;s plugin a try. I&#8217;ve included this plugin on my <a href="http://www.thewhyandthehow.com/open-source-tools/">open source tools page</a>.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/8xAQ__Pb-OeMQQ3xiMUIgGanpVg/0/da"><img src="http://feedads.g.doubleclick.net/~a/8xAQ__Pb-OeMQQ3xiMUIgGanpVg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/8xAQ__Pb-OeMQQ3xiMUIgGanpVg/1/da"><img src="http://feedads.g.doubleclick.net/~a/8xAQ__Pb-OeMQQ3xiMUIgGanpVg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=U9z32741ONo:gRkwpHu2vFs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=U9z32741ONo:gRkwpHu2vFs:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=U9z32741ONo:gRkwpHu2vFs:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=U9z32741ONo:gRkwpHu2vFs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=U9z32741ONo:gRkwpHu2vFs:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=U9z32741ONo:gRkwpHu2vFs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=U9z32741ONo:gRkwpHu2vFs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=U9z32741ONo:gRkwpHu2vFs:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheWhyAndTheHow/~4/U9z32741ONo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.thewhyandthehow.com/facebook-connect-comments-as-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.thewhyandthehow.com/facebook-connect-comments-as-wordpress-plugin/</feedburner:origLink></item>
		<item>
		<title>Doing more at once</title>
		<link>http://feedproxy.google.com/~r/TheWhyAndTheHow/~3/ldUCyPObbrI/</link>
		<comments>http://www.thewhyandthehow.com/doing-more-at-once/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 17:48:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[facebook]]></category>

		<guid isPermaLink="false">http://www.thewhyandthehow.com/?p=736</guid>
		<description><![CDATA[I&#8217;ve been doing a lot of work with curl_multi in PHP lately because it just makes sense to do as much work in parallel as possible (in most cases). I&#8217;ll be writing up my experiences with curl_multi later.
So, yesterday&#8217;s announcement by the Facebook development team about fql.multiquery couldn&#8217;t have come at a better time for [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing a lot of work with <a href="http://us2.php.net/manual/en/function.curl-multi-exec.php">curl_multi in PHP</a> lately because it just makes sense to do as much work in parallel as possible (in most cases). I&#8217;ll be writing up my experiences with curl_multi later.</p>
<p>So, yesterday&#8217;s announcement by the Facebook development team about <a href="http://developers.facebook.com/news.php?blog=1&#038;story=257">fql.multiquery</a> couldn&#8217;t have come at a better time for me. Experienced web developers (and multi-tiered application developers in general) have all learned that performing work in the proper tier is always the most efficient way to work. Data should be managed in the database tier and as separately from the application tier as possible. This announcement from the Facebook development team is great news for Facebook application developers everywhere. Kudos to them!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/lvpItwN_1qypBUEiGslwDa2AQKo/0/da"><img src="http://feedads.g.doubleclick.net/~a/lvpItwN_1qypBUEiGslwDa2AQKo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/lvpItwN_1qypBUEiGslwDa2AQKo/1/da"><img src="http://feedads.g.doubleclick.net/~a/lvpItwN_1qypBUEiGslwDa2AQKo/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=ldUCyPObbrI:mdPJZ9Qq4l0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=ldUCyPObbrI:mdPJZ9Qq4l0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=ldUCyPObbrI:mdPJZ9Qq4l0:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=ldUCyPObbrI:mdPJZ9Qq4l0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=ldUCyPObbrI:mdPJZ9Qq4l0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=ldUCyPObbrI:mdPJZ9Qq4l0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=ldUCyPObbrI:mdPJZ9Qq4l0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=ldUCyPObbrI:mdPJZ9Qq4l0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheWhyAndTheHow/~4/ldUCyPObbrI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.thewhyandthehow.com/doing-more-at-once/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.thewhyandthehow.com/doing-more-at-once/</feedburner:origLink></item>
		<item>
		<title>Another way to cache</title>
		<link>http://feedproxy.google.com/~r/TheWhyAndTheHow/~3/dXcPeJffHgs/</link>
		<comments>http://www.thewhyandthehow.com/another-way-to-cache/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 23:23:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.thewhyandthehow.com/?p=731</guid>
		<description><![CDATA[Obviously, I&#8217;m a big fan of the performance increases that can be achieved by using memcache. Another potential cache-based tool for enhancing your server-side PHP code is to use an opcode compiler and caching tool such as APC.
In addition to being a fantastic piece of technology by itself, APC also provides meaningful tuning options and [...]]]></description>
			<content:encoded><![CDATA[<p>Obviously, I&#8217;m a big fan of the performance increases that can be achieved by using <a href="http://www.thewhyandthehow.com/memcache-memcache-memcache/">memcache</a>. Another potential cache-based tool for enhancing your server-side PHP code is to use an <a href="http://en.wikipedia.org/wiki/PHP_accelerator">opcode compiler and caching tool</a> such as <a href="http://us2.php.net/apc">APC</a>.</p>
<p><img src="http://www.thewhyandthehow.com/wp-content/uploads/2009/06/apc-stats-graph-286x300.png" alt="apc-stats-graph" title="apc-stats-graph" width="286" height="300" class="left border size-medium wp-image-732" />In addition to being a fantastic piece of technology by itself, APC also provides meaningful <a href="http://us3.php.net/manual/en/apc.configuration.php">tuning options</a> and detailed statistics. The screen shot here shows just a fraction of the information collected by APC.</p>
<p>So far, my experience with APC has been very positive, but don&#8217;t take my word for it. Check out some of the performance results: <a href="http://coder1.com/articles/php-apc-performance-tests-apache-ab">here</a>, <a href="http://mediakey.dk/~cc/php-52-and-apc-alternative-php-cache-performance/">here</a> and <a href="http://blog.digitalstruct.com/2007/12/23/php-accelerators-apc-vs-zend-vs-xcache-with-zend-framework/">here</a>.</p>
<p>As always, tuning to a particular application or server is critical. Be sure to <a href="http://us2.php.net/apc">read the manual</a>!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/I_UZF5dzb9Bn6i_nsyk5QNJ0TvQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/I_UZF5dzb9Bn6i_nsyk5QNJ0TvQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/I_UZF5dzb9Bn6i_nsyk5QNJ0TvQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/I_UZF5dzb9Bn6i_nsyk5QNJ0TvQ/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=dXcPeJffHgs:T4cGVM-UmfY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=dXcPeJffHgs:T4cGVM-UmfY:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=dXcPeJffHgs:T4cGVM-UmfY:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=dXcPeJffHgs:T4cGVM-UmfY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=dXcPeJffHgs:T4cGVM-UmfY:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=dXcPeJffHgs:T4cGVM-UmfY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=dXcPeJffHgs:T4cGVM-UmfY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=dXcPeJffHgs:T4cGVM-UmfY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheWhyAndTheHow/~4/dXcPeJffHgs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.thewhyandthehow.com/another-way-to-cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.thewhyandthehow.com/another-way-to-cache/</feedburner:origLink></item>
		<item>
		<title>Google Chrome for Linux</title>
		<link>http://feedproxy.google.com/~r/TheWhyAndTheHow/~3/G9_oYF6tiTc/</link>
		<comments>http://www.thewhyandthehow.com/google-chrome-for-linux/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 17:18:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://www.thewhyandthehow.com/?p=728</guid>
		<description><![CDATA[On Monday I downloaded Google&#8217;s Chrome browser for Ubuntu to test it out (against all warnings).
I&#8217;m happy to say that despite the missing features, this browser is absolutely amazing on Ubuntu. It&#8217;s lightning fast and very stable. I can&#8217;t browse to pages that require HTTP AUTH &#8212; but that&#8217;s the only thing I&#8217;ve found that [...]]]></description>
			<content:encoded><![CDATA[<p>On Monday I downloaded Google&#8217;s <a href="http://dev.chromium.org/getting-involved/dev-channel">Chrome browser for Ubuntu</a> to test it out (<a href="http://blog.chromium.org/2009/06/danger-mac-and-linux-builds-available.html">against all warnings</a>).</p>
<p>I&#8217;m happy to say that despite the missing features, this browser is absolutely amazing on Ubuntu. It&#8217;s lightning fast and very stable. I can&#8217;t browse to pages that require HTTP AUTH &#8212; but that&#8217;s the only thing I&#8217;ve found that I didn&#8217;t notice in the limitations documentation.</p>
<p>Unfortunately Firefox on Ubuntu is not great, so I&#8217;m hoping that soon Chrome will be my browser of choice. Or I could just get a Mac.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/3ZU8nvfRwQyCfYBQgt79FbPHt7s/0/da"><img src="http://feedads.g.doubleclick.net/~a/3ZU8nvfRwQyCfYBQgt79FbPHt7s/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/3ZU8nvfRwQyCfYBQgt79FbPHt7s/1/da"><img src="http://feedads.g.doubleclick.net/~a/3ZU8nvfRwQyCfYBQgt79FbPHt7s/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=G9_oYF6tiTc:A07IA6m_qgY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=G9_oYF6tiTc:A07IA6m_qgY:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=G9_oYF6tiTc:A07IA6m_qgY:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=G9_oYF6tiTc:A07IA6m_qgY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=G9_oYF6tiTc:A07IA6m_qgY:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=G9_oYF6tiTc:A07IA6m_qgY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=G9_oYF6tiTc:A07IA6m_qgY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=G9_oYF6tiTc:A07IA6m_qgY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheWhyAndTheHow/~4/G9_oYF6tiTc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.thewhyandthehow.com/google-chrome-for-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.thewhyandthehow.com/google-chrome-for-linux/</feedburner:origLink></item>
		<item>
		<title>Poor programmer’s website monitor</title>
		<link>http://feedproxy.google.com/~r/TheWhyAndTheHow/~3/pYTzM5I-dK4/</link>
		<comments>http://www.thewhyandthehow.com/poor-programmers-website-monitor/#comments</comments>
		<pubDate>Tue, 26 May 2009 15:30:19 +0000</pubDate>
		<dc:creator>Blake Schwendiman</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.thewhyandthehow.com/?p=720</guid>
		<description><![CDATA[If you manage your own web site, it&#8217;s critical to know when there are problems, and hopefully you&#8217;ll know before your users do. There are several enterprise-grade server monitors and website monitors available ranging from free to expensive, but if you need something right now that&#8217;s simple and free, you might consider the solution I [...]]]></description>
			<content:encoded><![CDATA[<p>If you manage your own web site, it&#8217;s critical to know when there are problems, and hopefully you&#8217;ll know before your users do. There are several enterprise-grade server monitors and website monitors available ranging from free to expensive, but if you need something right now that&#8217;s simple and free, you might consider the solution I put together using <a href="http://www.montastic.com/">Montastic</a>, <a href="http://pipes.yahoo.com/pipes/">Yahoo! Pipes</a> and my cell phone.</p>
<p>My solution is not enterprise and it&#8217;s not real time, but it will let me know in a reasonable amount of time (Montastic says it checks every 10 minutes or so, based on load). For me, that&#8217;s good enough right now because I mostly want to avoid overnight and weekend-long outages that may occur when I&#8217;m not checking my computer regularly.</p>
<p>The first step is to sign up at <a href="http://www.montastic.com/signup">Montastic</a> and set up a monitor for your web site. There&#8217;s no learning curve there &#8230; just register, type in a URL and Montastic will start monitoring right away. There&#8217;s a <a href="http://www.montastic.com/video.html">video screen cast</a> available showing how easy it is to use. After setting up the monitors, Montastic provides a basic RSS feed &#8212; that&#8217;s where <a href="http://pipes.yahoo.com/pipes/">Yahoo! Pipes</a> comes in.</p>
<p><div id="attachment_722" class="wp-caption alignright" style="width: 150px">
	<a href="http://www.thewhyandthehow.com/wp-content/uploads/2009/05/yahoo-pipes-pipe.png"><img src="http://www.thewhyandthehow.com/wp-content/uploads/2009/05/yahoo-pipes-pipe-150x150.png" alt="Yahoo! Pipes Configuration for Montastic" title="yahoo-pipes-pipe" width="150" height="150" class="size-thumbnail wp-image-722" /></a>
	<p class="wp-caption-text">Yahoo! Pipes Configuration for Montastic</p>
</div>If you&#8217;re not familiar with Yahoo! Pipes, you should <a href="http://www.jumpcut.com/fullscreen?id=F4396574585311DC87A2000423CF0184&#038;type=clip">watch this video</a> for a brief introduction. For my monitor application, I built a very simple pipe that takes the output of the Montastic RSS feed, filters out all items that have the text [OK] in the title and then simply return the remaining titles. The entire pipe layout is in the attached screenshot.</p>
<p>The final step I took was to simply run the pipe, then tell Yahoo! to send me the output of the pipe to my cell phone whenever it changes. Since the pipe updates when there is a new failure item, I won&#8217;t get an SMS message every time Montastic checks the servers, but only when there is a new failure item.</p>
<p>I haven&#8217;t been running this solution for very long, but so far it looks to be a promising concept for keeping an eye on my servers &#8212; particularly when I&#8217;m going to be away for a while. I&#8217;d love to hear ideas about other ways to use Montastic or suggestions for other free website monitoring tools. What do you use?</p>

<p><a href="http://feedads.g.doubleclick.net/~a/6e1fVaS3FFyd5BexA3Qv46KiHbM/0/da"><img src="http://feedads.g.doubleclick.net/~a/6e1fVaS3FFyd5BexA3Qv46KiHbM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/6e1fVaS3FFyd5BexA3Qv46KiHbM/1/da"><img src="http://feedads.g.doubleclick.net/~a/6e1fVaS3FFyd5BexA3Qv46KiHbM/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=pYTzM5I-dK4:_SZutK7q5X0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=pYTzM5I-dK4:_SZutK7q5X0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=pYTzM5I-dK4:_SZutK7q5X0:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=pYTzM5I-dK4:_SZutK7q5X0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=pYTzM5I-dK4:_SZutK7q5X0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=pYTzM5I-dK4:_SZutK7q5X0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=pYTzM5I-dK4:_SZutK7q5X0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=pYTzM5I-dK4:_SZutK7q5X0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheWhyAndTheHow/~4/pYTzM5I-dK4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.thewhyandthehow.com/poor-programmers-website-monitor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.thewhyandthehow.com/poor-programmers-website-monitor/</feedburner:origLink></item>
		<item>
		<title>Building a Twitter mashup</title>
		<link>http://feedproxy.google.com/~r/TheWhyAndTheHow/~3/1n3ivgT-qW0/</link>
		<comments>http://www.thewhyandthehow.com/building-a-twitter-mashup/#comments</comments>
		<pubDate>Fri, 22 May 2009 16:46:50 +0000</pubDate>
		<dc:creator>Blake Schwendiman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.thewhyandthehow.com/?p=714</guid>
		<description><![CDATA[This week at Squidoo we released a new Twitter tool that provides a way to aggregate, archive and evangelize the best tweets by topic. We call it TwttrList. Having been a part of its development I wanted to write a brief post about the experience.
TwttrList is deeply integrated with the Twitter API, taking advantage of [...]]]></description>
			<content:encoded><![CDATA[<p>This week at <a href="http://www.squidoo.com">Squidoo</a> we released a new Twitter tool that provides a way to aggregate, archive and evangelize the best tweets by topic. We call it <a href="http://www.squidoo.com/twttrlist/hq">TwttrList</a>. Having been a part of its development I wanted to write a brief post about the experience.</p>
<p>TwttrList is deeply integrated with the <a href="http://apiwiki.twitter.com/Twitter-API-Documentation">Twitter API</a>, taking advantage of the search, timeline, status, and favorites interfaces. Because of the timing of our release relative to the release, subsequent <a href="http://www.thewhyandthehow.com/twitter-oauth-vulnerability-and-service-interconnectedness/">unrelease</a> and re-release of <a href="http://apiwiki.twitter.com/OAuth-FAQ">OAuth for Twitter</a>, we built almost all of the API requests to support both OAuth and username/password. The code for any Twitter request looks like this (slightly simplified):</p>

<div id="wp_codebox_msgheader"><span class="right"><a href="javascript:;" onclick="toggle_collapse('p7148');">[<span id="p7148_symbol">-</span>]</a><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p714code8'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div id="wp_codebox"><table width="100%" ><tr id="p7148"><td class="code" id="p714code8"><pre class="php"><span style="color: #666666; font-style: italic;">/**
 * Return favorite tweets list for user specified by OAuth or user/pass.
 *   doc: http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-favorites
 *
 * @param MemberTwitterData object
 * @return list of favorites or null
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.php.net/static"><span style="color: #990000;">static</span></a> <span style="color: #000000; font-weight: bold;">function</span> getUserFavorites<span style="color: #009900;">&#40;</span><span style="color: #000033;">$client_twitter_data</span><span style="color: #339933;">,</span> <span style="color: #000033;">$page</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000033;">$cache_key</span> <span style="color: #339933;">=</span> internal_hash<span style="color: #009900;">&#40;</span><span style="color: #000033;">$client_twitter_data</span><span style="color: #339933;">,</span> <span style="color: #339933;">...</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000033;">$res</span> <span style="color: #339933;">=</span> ApplicationHelper<span style="color: #339933;">::</span><span style="color: #004000;">memcacheGet</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$cache_key</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000033;">$res</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'none'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">null</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">return</span> <span style="color: #000033;">$res</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
   <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>self<span style="color: #339933;">::</span><span style="color: #000033;">$use_oauth</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000033;">$curl_options</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>CURLOPT_POST <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span>
                          CURLOPT_HTTPHEADER <span style="color: #339933;">=&gt;</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Expect:'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                          CURLOPT_USERPWD <span style="color: #339933;">=&gt;</span> <span style="color: #000033;">$client_twitter_data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">screen_name</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">':'</span> <span style="color: #339933;">.</span> <span style="color: #000033;">$client_twitter_data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">twitter_password</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000033;">$results</span> <span style="color: #339933;">=</span> ApplicationHelper<span style="color: #339933;">::</span><span style="color: #004000;">rest_connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'https://twitter.com/favorites.json'</span><span style="color: #339933;">,</span> <span style="color: #339933;">...,</span>  <span style="color: #000033;">$curl_options</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000033;">$results</span> <span style="color: #339933;">===</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000033;">$results</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">null</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000033;">$oauth</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TwitterOAuth<span style="color: #009900;">&#40;</span>self<span style="color: #339933;">::</span><span style="color: #000033;">$app_token</span><span style="color: #339933;">,</span> self<span style="color: #339933;">::</span><span style="color: #000033;">$app_secret</span><span style="color: #339933;">,</span> <span style="color: #000033;">$client_twitter_data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">oauth_token</span><span style="color: #339933;">,</span> <span style="color: #000033;">$client_twitter_data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">oauth_secret</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000033;">$results</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$oauth</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">OAuthRequest</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'https://twitter.com/favorites.json'</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: #0000ff;">'page'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000033;">$page</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'GET'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000033;">$oauth</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">lastStatusCode</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">200</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000033;">$results</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">null</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000033;">$results</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000033;">$results</span> <span style="color: #339933;">=</span> json_decode<span style="color: #009900;">&#40;</span><span style="color: #000033;">$results</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    ApplicationHelper<span style="color: #339933;">::</span><span style="color: #004000;">memcacheSet</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$cache_key</span><span style="color: #339933;">,</span> <span style="color: #000033;">$results</span><span style="color: #339933;">,</span> <span style="color: #339933;">...</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    ApplicationHelper<span style="color: #339933;">::</span><span style="color: #004000;">memcacheSet</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$cache_key</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'none'</span><span style="color: #339933;">,</span> <span style="color: #339933;">...</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #b1b100;">return</span> <span style="color: #000033;">$results</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The Twitter OAuth library I chose is the one provided by <a href="http://twitter.abrah.am/">Abraham Williams</a> and despite the warnings in the comments about not using the library in production code, I found the library to be very stable and usable. </p>
<p>With this structure in place, we were able to switch between using OAuth and Twitter usernames/passwords by simply setting a single boolean value in the Twitter helper class. With the boolean <em>use_oauth</em> set to false, the authentication popup screen we developed displays a username/password form. When true, the popup screen goes through the actual OAuth process. Switching mid-stream is possible as well because each time authentication is required we can simply re-request the new user credentials.</p>
<p>TwttrList obviously uses a lot of <a href="http://www.thewhyandthehow.com/memcache-memcache-memcache/">request caching</a>. We cache everything we possibly can using timeouts for each type of data based on our best judgment. Search requests are cached for a shorter time than user favorites, for example.</p>
<p>The final large coding piece was to develop a reusable Javascript class to provide consistent display and AJAX functionality on all the pages that are involved in the TwttrList lens display. This class is mostly agnostic to any framework (<a href="http://jquery.com/">jQuery</a>, <a href="http://www.prototypejs.org/">Prototype</a>) because Squidoo is transitioning between frameworks at the moment. The JS for TwttrList is lightweight and very reusable.</p>
<p>The real magic of TwttrList is in its usability, concept and design which is a group effort by the whole <a href="http://www.squidoo.com/squidoo">Squidoo team</a>. It takes a village to create a great software application and I&#8217;m part of one of the best villages around. The creative elements of the design and the constant attention to usability details throughout the application make TwttrList something more than just the nuts and bolts of the code.</p>
<p>Take a look at <a href="http://www.squidoo.com/twttrlist/hq">TwttrList</a> today and let me know what you think. I&#8217;d love to answer questions about the implementation (within reason), so ask away!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/81iiuK9YmtjHfCfbyN0fSkFVs0k/0/da"><img src="http://feedads.g.doubleclick.net/~a/81iiuK9YmtjHfCfbyN0fSkFVs0k/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/81iiuK9YmtjHfCfbyN0fSkFVs0k/1/da"><img src="http://feedads.g.doubleclick.net/~a/81iiuK9YmtjHfCfbyN0fSkFVs0k/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=1n3ivgT-qW0:-JqnyeqsAZU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=1n3ivgT-qW0:-JqnyeqsAZU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=1n3ivgT-qW0:-JqnyeqsAZU:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=1n3ivgT-qW0:-JqnyeqsAZU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=1n3ivgT-qW0:-JqnyeqsAZU:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=1n3ivgT-qW0:-JqnyeqsAZU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?i=1n3ivgT-qW0:-JqnyeqsAZU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?a=1n3ivgT-qW0:-JqnyeqsAZU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/TheWhyAndTheHow?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheWhyAndTheHow/~4/1n3ivgT-qW0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.thewhyandthehow.com/building-a-twitter-mashup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.thewhyandthehow.com/building-a-twitter-mashup/</feedburner:origLink></item>
	</channel>
</rss>
