<?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:series="http://unfoldingneurons.com/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Joel's Blog</title>
	
	<link>http://joelvanhorn.com</link>
	<description>A snapshot.</description>
	<lastBuildDate>Fri, 06 Apr 2012 13:18:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/JoelVH" /><feedburner:info uri="joelvh" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>JoelVH</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Pre-populating Shopify Checkout Forms and Other Undocumented Functionality</title>
		<link>http://feedproxy.google.com/~r/JoelVH/~3/OPbXndNMGnA/</link>
		<comments>http://joelvanhorn.com/2012/03/24/pre-filling-shopify-checkout-forms/#comments</comments>
		<pubDate>Sat, 24 Mar 2012 20:22:44 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[mechanize]]></category>
		<category><![CDATA[shopify]]></category>

		<guid isPermaLink="false">http://joelvanhorn.com/?p=292</guid>
		<description><![CDATA[We&#8217;ve been using Shopify at ThankLab and chose them because they&#8217;re a hosted solution and have a simple API. However, we quickly uncovered many limitations that required us to come up with workarounds. Some of the issues we had to resolve were a result of integrating Shopify into a third-party website with existing user accounts. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://joelvanhorn.com/files/2012/03/bandaids1.jpg"><img class="aligncenter size-full wp-image-314" title="Bandaids" src="http://joelvanhorn.com/files/2012/03/bandaids1.jpg" alt="Bandaids" width="580" height="318" /></a></p>
<p>We&#8217;ve been using <a title="Shopify" href="http://shopify.com" target="_blank">Shopify</a> at <a title="ThankLab" href="http://thanklab.com" target="_blank">ThankLab</a> and chose them because they&#8217;re a hosted solution and have a simple API. However, we quickly uncovered many limitations that required us to come up with workarounds. Some of the issues we had to resolve were a result of integrating Shopify into a third-party website with existing user accounts.</p>
<p>As we dug into documentation on the official Shopify wiki and blog, it became clear that many of the solutions they provide are their own hacks around limitations many customers have run into. This realization was double-edged: Shopify clearly encourages hacking on their platform, but many capabilities or &#8220;features&#8221; are not really baked into their core product. In the end (frustrations aside), the challenge of making Shopify work for us became an exercise in creativity.</p>
<h3>Seamlessly integrating third-party user accounts with Shopify checkout</h3>
<p>Our users login to our website and checkout on Shopify. Shopify has these 3 options at checkout:</p>
<p style="text-align: center;"><a href="http://joelvanhorn.com/files/2012/03/Screen-Shot-2012-03-24-at-2.22.24-PM.png"><img class="aligncenter  wp-image-307" title="Shopify checkout options" src="http://joelvanhorn.com/files/2012/03/Screen-Shot-2012-03-24-at-2.22.24-PM.png" alt="Shopify checkout options" width="552" height="137" /></a></p>
<ul>
<li>Guest checkout &#8211; requires the customer to enter their email address</li>
<li>Customer login only &#8211; requires email and password to login, however each customer needs to be manually invited via email to create passwords for their account</li>
</ul>
<p><em><strong>Goal:</strong> pre-fill email address on guest checkout page (and hide email field)</em></p>
<p><em><strong>Shopify limitations:</strong> Checkout page has a unique URL (is not known ahead of time), does not accept query string parameters to pre-fill form fields, and only allows you to customize CSS.</em></p>
<h4>Get the Shopify checkout URL ahead of time</h4>
<p>I kinda lied there a little bit. The checkout page CAN be determined ahead of time, but because the URL has a random looking token in it, it isn&#8217;t immediately evident. Here&#8217;s an example of my cart on the <a href="http://store.penny-arcade.com/">Penny Arcade</a> store:</p>
<p style="text-align: center;"><a href="http://joelvanhorn.com/files/2012/03/Screen-Shot-2012-03-24-at-2.13.31-PM.png"><img class="aligncenter  wp-image-301" title="Shopify checkout URL" src="http://joelvanhorn.com/files/2012/03/Screen-Shot-2012-03-24-at-2.13.31-PM.png" alt="Shopify checkout URL" width="542" height="120" /></a></p>
<pre></pre>
<p>As it turns out, the ID in the URL is <strong>your shop ID</strong> (429942) and is always the same for all customers. The 32-character ID (c813f407436dc8cdda0c50d58e6d5e96) is your <strong>cart token</strong>, which is stored in a cookie called &#8220;cart&#8221;. To get the checkout URL for each customer, you&#8217;ll have to use JavaScript:</p>
<ol>
<li>Get your shop ID from your checkout page URL (simply click &#8220;checkout&#8221; in your shop)</li>
<li>Create a JavaScript function that can read the &#8220;cart&#8221; cookie (<a href="http://www.quirksmode.org/js/cookies.html#script" target="_blank">here&#8217;s some code you can use</a>)</li>
<li>Create a JavaScript function that combines everything into a proper URL and do something with it</li>
</ol>
<p>After combining these steps, you might have some JavaScript code that looks something like this:</p>
<pre>var shop_id = "429942";
var checkout_url = "https://checkout.shopify.com/carts/" + shop_id + "/" + readCookie("cart");</pre>
<p>We will use this URL to add some parameters to pre-fill the checkout form. <a href="https://github.com/joelvh/shopify_hacks" target="_blank">Download my example script (shopify_hacks.js) from Github.</a></p>
<h4>Pre-filling the Shopify checkout form</h4>
<p>We are now able to determine the Shopify checkout URL ahead of time, but need to pre-fill the form. If you&#8217;re familiar with <a title="Ruby on Rails" href="http://rubyonrails.org/" target="_blank">Ruby on Rails</a> or web development frameworks in general, you know that you can typically take the names of form fields and add them to the URL as query string values. Those values are then pre-populated in forms that have fields matching those parameters.</p>
<p>In the case of the checkout form, if you view the HTML source of the page in your browser and find the &#8220;input&#8221; tags, you&#8217;ll find the field for the email address on guest checkout. The name is &#8220;order[email]&#8220;. Now, when you add that name as a query string value, the checkout URL looks like this:</p>
<p style="text-align: center;"><a href="http://joelvanhorn.com/files/2012/03/Screen-Shot-2012-03-24-at-2.18.05-PM.png"><img class="aligncenter  wp-image-304" title="Shopify checkout URL with email parameter" src="http://joelvanhorn.com/files/2012/03/Screen-Shot-2012-03-24-at-2.18.05-PM.png" alt="Shopify checkout URL with email parameter" width="525" height="153" /></a></p>
<p>Unfortunately this didn&#8217;t work. The email address is still blank. However, if you submit the form with invalid information (e.g. blank email address), you&#8217;ll notice that the cart URL changes. The URL now ends in &#8220;create_order&#8221;:</p>
<p style="text-align: center;"><a href="http://joelvanhorn.com/files/2012/03/Screen-Shot-2012-03-24-at-2.29.16-PM.png"><img class="aligncenter  wp-image-306" title="Shopify checkout URL for populating form fields" src="http://joelvanhorn.com/files/2012/03/Screen-Shot-2012-03-24-at-2.29.16-PM.png" alt="Shopify checkout URL for populating form fields" width="563" height="120" /></a></p>
<p> Now you can see that my email address is pre-populated in the form. You can pre-populate all form fields if you wish. In our case we are only pre-populating the email field and using CSS to hide the table row. This effectively lets our users checkout without re-entering the email address we already know.<br />
<a name="mechanize"></a><br />
<h4>Alternatively, use Mechanize to automate creating Shopify customer accounts with passwords</h4>
<p><em><strong>Goal:</strong> Create Shopify customer logins linked to third-party user database</em></p>
<p><em><strong>Shopify limitation:</strong> Shopify customer logins can only be created by inviting a customer (manually) via email, at which point customers can create a password.</em></p>
<p>Originally wanted to create a Shopify customer account for each user in our third-party database, but Shopify doesn&#8217;t let you create customer accounts through the API. For some reason the only way to create a Shopify customer account is to manually &#8220;invite&#8221; the user via email, which sends them a link to create a password. We ended up automating this process using <a title="Mechanize" href="http://mechanize.rubyforge.org/" target="_blank">Mechanize</a>:</p>
<ol>
<li><a href="http://api.shopify.com/customer.html" target="_blank">Create a Shopify customer using the API</a></li>
<li>Create a Shopify administrator account that only has access to Customers</li>
<li>Mechanize logs in to shop admin with administrator account</li>
<li>Mechanize retrieves the invite link for a customer</li>
<li>Mechanize visits the invite link and fills out the form to create a password</li>
</ol>
<p>Pretty simple. However, we felt that this was less reliable than the guest checkout method. This process would also sometimes take up to 7 seconds to complete, and we decided it would add more complexity to our application to deal with this latency, as well as making sure that our users would be logged in to their Shopify accounts behind the scenes reliably (read: posting their Shopify username and password to the login form on Shopify in a hidden iframe).</p>
<p><a href="https://github.com/joelvh/shopify_hacks" target="_blank">Download the mechanize script (mechanize_activate_customer_login.rb) from Github.</a> It&#8217;s a Ruby script that you can run from the command line. It accepts several arguments and outputs how long each step takes. Make sure to install the Mechanize gem before running the script.</p>
<h3>Some other convenient undocumented Shopify functionality discovered</h3>
<p>We actually have our own custom cart on a website separate from Shopify. So, when users click the &#8220;checkout&#8221; button, we need to &#8220;copy&#8221; the items we have in our cart to the Shopify cart. To do this, we first need to clear their existing Shopify cart and then post all items to Shopify.</p>
<h4>Redirect after clearing Shopify cart</h4>
<p>To clear a Shopify cart, you visit the &#8220;/cart/clear&#8221; page. After the cart is cleared, it automatically redirects you back to the empty cart page:</p>
<pre>http://store.penny-arcade.com/cart/clear</pre>
<p>However, if you want to send your user to a page of your choosing, all you have to do is add that page to the URL as a &#8220;return_to&#8221; parameter:</p>
<pre>http://store.penny-arcade.com/cart/clear<strong>?return_to=</strong>http://joelvanhorn.com</pre>
<p>This parameter is documented for adding products to the cart, but not any other pages. Presumably, you can add the &#8220;return_to&#8221; parameter to more pages that perform actions within Shopify.</p>
<p>&nbsp;</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fjoelvanhorn.com%2F2012%2F03%2F24%2Fpre-filling-shopify-checkout-forms%2F&amp;counturl=http%3A%2F%2Fjoelvanhorn.com%2F2012%2F03%2F24%2Fpre-filling-shopify-checkout-forms%2F&amp;count=none&amp;text=Pre-populating%20Shopify%20Checkout%20Forms%20and%20Other%20Undocumented%20Functionality" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fjoelvanhorn.com%2F2012%2F03%2F24%2Fpre-filling-shopify-checkout-forms%2F&amp;counturl=http%3A%2F%2Fjoelvanhorn.com%2F2012%2F03%2F24%2Fpre-filling-shopify-checkout-forms%2F&amp;count=none&amp;text=Pre-populating%20Shopify%20Checkout%20Forms%20and%20Other%20Undocumented%20Functionality" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjoelvanhorn.com%2F2012%2F03%2F24%2Fpre-filling-shopify-checkout-forms%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjoelvanhorn.com%2F2012%2F03%2F24%2Fpre-filling-shopify-checkout-forms%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjoelvanhorn.com%2F2012%2F03%2F24%2Fpre-filling-shopify-checkout-forms%2F&amp;title=Pre-populating%20Shopify%20Checkout%20Forms%20and%20Other%20Undocumented%20Functionality" id="wpa2a_2"><img src="http://joelvanhorn.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><img src="http://feeds.feedburner.com/~r/JoelVH/~4/OPbXndNMGnA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joelvanhorn.com/2012/03/24/pre-filling-shopify-checkout-forms/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://joelvanhorn.com/2012/03/24/pre-filling-shopify-checkout-forms/</feedburner:origLink></item>
		<item>
		<title>Easily Transform JSON with json2json</title>
		<link>http://feedproxy.google.com/~r/JoelVH/~3/Wlf-41MAW9U/</link>
		<comments>http://joelvanhorn.com/2012/01/05/easily-reformat-json-with-json2json/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 16:00:41 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://joelvanhorn.com/?p=277</guid>
		<description><![CDATA[I have been working on an auto-complete web service that searches Amazon&#8217;s Product Advertising API.  I built it in Node.js and using the APAC package made it really easy to query the API. The only thing that was extremely impractical was the JSON data returned by APAC. Since Amazon&#8217;s API only returns data as XML, APAC [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://joelvanhorn.com/files/2012/01/transmogrifier.gif"><img class="aligncenter size-full wp-image-278" title="Transmogrifier" src="http://joelvanhorn.com/files/2012/01/transmogrifier.gif" alt="" width="234" height="300" /></a></p>
<p>I have been working on an auto-complete web service that searches Amazon&#8217;s <a href="http://aws.amazon.com/associates/" target="_blank">Product Advertising API</a>.  I built it in <a href="http://nodejs.org/" target="_blank">Node.js</a> and using the <a href="https://github.com/joelvh/node-apac" target="_blank">APAC package</a> made it really easy to query the API. The only thing that was extremely impractical was the JSON data returned by APAC.</p>
<p>Since Amazon&#8217;s API only returns data as XML, APAC uses <a href="https://github.com/buglabs/node-xml2json" target="_blank">xml2json</a> to convert the XML to JSON. Unfortunately the resulting JSON is <a href="https://github.com/joelvh/json2json/blob/master/example/original.json" target="_blank">quite ugly</a>. I wanted to be able to choose the data I needed and copy it to a <a href="https://github.com/joelvh/json2json/blob/master/example/transformed.json" target="_blank">new, clean JSON format</a>. My solution was to create <a href="https://github.com/joelvh/json2json" target="_blank">json2json</a>.</p>
<p><strong>json2json</strong> lets you create a template that describes how to transform the original JSON to a new structure. I wrote the Node.js <a href="http://search.npmjs.org/#/json2json" target="_blank">package</a> and <a href="https://github.com/joelvh/json2json/blob/master/example/template.coffee" target="_blank">example template</a> in <a href="http://coffeescript.org/" target="_blank">CoffeeScript</a> because it has a much cleaner and simpler syntax than JavaScript. However, it is extremely simple to convert to JavaScript (<a href="http://coffeescript.org/" target="_blank">click on &#8220;Try CoffeeScript&#8221;</a>) and can easily be modified for use in a browser. Check out the (crude) <a href="https://github.com/joelvh/json2json" target="_blank">documentation</a> and <a href="https://github.com/joelvh/json2json/tree/master/example" target="_blank">example files</a> and let me know what you think.</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fjoelvanhorn.com%2F2012%2F01%2F05%2Feasily-reformat-json-with-json2json%2F&amp;counturl=http%3A%2F%2Fjoelvanhorn.com%2F2012%2F01%2F05%2Feasily-reformat-json-with-json2json%2F&amp;count=none&amp;text=Easily%20Transform%20JSON%20with%20json2json" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fjoelvanhorn.com%2F2012%2F01%2F05%2Feasily-reformat-json-with-json2json%2F&amp;counturl=http%3A%2F%2Fjoelvanhorn.com%2F2012%2F01%2F05%2Feasily-reformat-json-with-json2json%2F&amp;count=none&amp;text=Easily%20Transform%20JSON%20with%20json2json" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjoelvanhorn.com%2F2012%2F01%2F05%2Feasily-reformat-json-with-json2json%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjoelvanhorn.com%2F2012%2F01%2F05%2Feasily-reformat-json-with-json2json%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjoelvanhorn.com%2F2012%2F01%2F05%2Feasily-reformat-json-with-json2json%2F&amp;title=Easily%20Transform%20JSON%20with%20json2json" id="wpa2a_4"><img src="http://joelvanhorn.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><img src="http://feeds.feedburner.com/~r/JoelVH/~4/Wlf-41MAW9U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joelvanhorn.com/2012/01/05/easily-reformat-json-with-json2json/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joelvanhorn.com/2012/01/05/easily-reformat-json-with-json2json/</feedburner:origLink></item>
		<item>
		<title>FBAPI.js: Facebook JavaScript SDK Simplified</title>
		<link>http://feedproxy.google.com/~r/JoelVH/~3/k4ymRRJuHsw/</link>
		<comments>http://joelvanhorn.com/2011/12/17/fbapi-js-facebook-javascript-sdk-simplified/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 22:01:01 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[FBAPI.js]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://joelvanhorn.com/?p=259</guid>
		<description><![CDATA[I&#8217;ve been working on Rembly using several javascript libraries: Spine.js, Mustache.js, ICanHaz.js, and Facebook&#8217;s JavaScript SDK. These have made application development easier, but not always easy enough! I wrote previously about my enhancements to ICanHaz.js for loading Mustache templates. This time around, I wanted to use Facebook&#8217;s JavaScript SDK with less &#8220;overhead&#8221; and a simplified [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://joelvanhorn.com/files/2011/12/open_graph_protocol_logo.png"><img class="aligncenter size-full wp-image-262" title="Facebook Open Graph logo" src="http://joelvanhorn.com/files/2011/12/open_graph_protocol_logo.png" alt="Facebook Open Graph logo" width="300" height="300" /></a></p>
<p>I&#8217;ve been working on <a title="Rembly" href="http://rembly.com" target="_blank">Rembly</a> using several javascript libraries: <a title="Spine.js" href="http://spinejs.com/" target="_blank">Spine.js</a>, <a title="Mustache" href="http://mustache.github.com/" target="_blank">Mustache.js</a>, <a title="ICanHaz.js on Github" href="https://github.com/joelvh/ICanHaz.js" target="_blank">ICanHaz.js</a>, and <a title="Facebook's JavaScript SDK" href="https://developers.facebook.com/docs/reference/javascript/" target="_blank">Facebook&#8217;s JavaScript SDK</a>. These have made application development easier, but not always easy enough! I wrote previously about <a href="http://joelvanhorn.com/2011/12/05/a-super-charged-version-of-icanhaz-js/">my enhancements to ICanHaz.js</a> for loading Mustache templates. This time around, I wanted to use Facebook&#8217;s JavaScript SDK with less &#8220;overhead&#8221; and a simplified API.</p>
<p>I created <strong><a title="FBAPI.js" href="https://github.com/joelvh/FBAPI.js" target="_blank">FBAPI.js</a></strong> to handle the setup requirements that Facebook&#8217;s SDK requires, such as adding a &#8220;root&#8221; tag to the page before loading the SDK. Now FBAPI.js takes care of all the SDK requirements and lets you use the <a title="Facebook's Graph API" href="https://developers.facebook.com/docs/reference/api/" target="_blank">Graph API</a> without worrying about the overhead. FBAPI.js adds helper methods for event binding and retrieving user data.  However, the best part of FBAPI.js is that you don&#8217;t have to wait for the page or javascript dependencies to be loaded before you can start using it! All methods use <a title="Promises" href="http://en.wikipedia.org/wiki/Futures_and_promises" target="_blank">promises</a> and <a title="Callbacks" href="http://en.wikipedia.org/wiki/Callback_(computer_programming)" target="_blank">callbacks</a>. This lets you run your scripts in any order you want!</p>
<p>Check out the <a title="FBAPI.js on Github" href="https://github.com/joelvh/FBAPI.js" target="_blank">Github repository</a> and let me know what you think!</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F17%2Ffbapi-js-facebook-javascript-sdk-simplified%2F&amp;counturl=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F17%2Ffbapi-js-facebook-javascript-sdk-simplified%2F&amp;count=none&amp;text=FBAPI.js%3A%20Facebook%20JavaScript%20SDK%20Simplified" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F17%2Ffbapi-js-facebook-javascript-sdk-simplified%2F&amp;counturl=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F17%2Ffbapi-js-facebook-javascript-sdk-simplified%2F&amp;count=none&amp;text=FBAPI.js%3A%20Facebook%20JavaScript%20SDK%20Simplified" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F17%2Ffbapi-js-facebook-javascript-sdk-simplified%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F17%2Ffbapi-js-facebook-javascript-sdk-simplified%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F17%2Ffbapi-js-facebook-javascript-sdk-simplified%2F&amp;title=FBAPI.js%3A%20Facebook%20JavaScript%20SDK%20Simplified" id="wpa2a_6"><img src="http://joelvanhorn.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><img src="http://feeds.feedburner.com/~r/JoelVH/~4/k4ymRRJuHsw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joelvanhorn.com/2011/12/17/fbapi-js-facebook-javascript-sdk-simplified/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joelvanhorn.com/2011/12/17/fbapi-js-facebook-javascript-sdk-simplified/</feedburner:origLink></item>
		<item>
		<title>Easily Overload JavaScript Functions with Optional Parameters</title>
		<link>http://feedproxy.google.com/~r/JoelVH/~3/18Oi5lTUs0M/</link>
		<comments>http://joelvanhorn.com/2011/12/12/easily-overload-javascript-functions-with-optional-parameters/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 04:04:42 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Sysmo.js]]></category>

		<guid isPermaLink="false">http://joelvanhorn.com/?p=267</guid>
		<description><![CDATA[I just answered a Stack Overflow question from a couple years ago titled &#8220;Handling optional parameters in javascript&#8220; and figured I&#8217;d write about my solution here. I&#8217;ll start by saying that the easiest way to handle optional parameters in javascript is to use an &#8220;options&#8221; object that allows a function to be called with as many [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://joelvanhorn.com/files/2011/12/overloading_the_car.jpg"><img class="aligncenter size-full wp-image-269" title="Overloaded" src="http://joelvanhorn.com/files/2011/12/overloading_the_car.jpg" alt="Overloaded" width="450" height="338" /></a></p>
<p>I just answered a <a title="Stack Overflow" href="http://joelvh.com/spwMGV" target="_blank">Stack Overflow</a> question from a couple years ago titled &#8220;<a title="Stack Overflow" href="http://joelvh.com/spwMGV" target="_blank">Handling optional parameters in javascript</a>&#8220; and figured I&#8217;d write about my solution here.</p>
<p>I&#8217;ll start by saying that the easiest way to handle optional parameters in javascript is to use an &#8220;options&#8221; object that allows a function to be called with as many or as few parameters (arguments) as you wish.</p>
<pre>function displayOverlay(options) {
  if (options.alert) { 
    alert(options.message); 
  }
}</pre>
<p>However, if you need to use individual parameters, i&#8217;ve created a utility that acts as a proxy and lets you strongly type values.  It looks like this:</p>
<pre>function displayOverlay(/*message, timeout, callback*/) {
  return proxy(arguments, String, Number, Function,
    function(message, timeout, callback) {
      /* ... your code ... */
    });
};</pre>
<p>I call my proxy <a title="GitHub" href="http://joelvh.com/ulKNgr" target="_blank">arrangeArgs()</a>. Here&#8217;s a clearer explanation of what&#8217;s going on:</p>
<pre>function displayOverlay(/*message, timeout, callback*/) {
  //arrangeArgs is the proxy
  return arrangeArgs(
           //first pass in the original arguments
           arguments,
           //then pass in the type for each argument
           String,  Number,  Function,
           //lastly, pass in your function and the proxy will do the rest!
           function(message, timeout, callback) {

             //debug output of each argument to verify it's working
             console.log("message", message, "timeout", timeout, "callback", callback);

             /* ... your code ... */

           }
         );
};</pre>
<p>I created the <a title="GitHub" href="http://joelvh.com/ulKNgr" target="_blank">arrangeArgs()</a> proxy to handle optional parameters for you.  It works nicely.  The code is in my <a title="GitHub" href="http://joelvh.com/ulKNgr" target="_blank">Sysmo.js utility library on GitHub</a>. Let me know what you think!</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F12%2Feasily-overload-javascript-functions-with-optional-parameters%2F&amp;counturl=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F12%2Feasily-overload-javascript-functions-with-optional-parameters%2F&amp;count=none&amp;text=Easily%20Overload%20JavaScript%20Functions%20with%20Optional%20Parameters" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F12%2Feasily-overload-javascript-functions-with-optional-parameters%2F&amp;counturl=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F12%2Feasily-overload-javascript-functions-with-optional-parameters%2F&amp;count=none&amp;text=Easily%20Overload%20JavaScript%20Functions%20with%20Optional%20Parameters" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F12%2Feasily-overload-javascript-functions-with-optional-parameters%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F12%2Feasily-overload-javascript-functions-with-optional-parameters%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F12%2Feasily-overload-javascript-functions-with-optional-parameters%2F&amp;title=Easily%20Overload%20JavaScript%20Functions%20with%20Optional%20Parameters" id="wpa2a_8"><img src="http://joelvanhorn.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><img src="http://feeds.feedburner.com/~r/JoelVH/~4/18Oi5lTUs0M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joelvanhorn.com/2011/12/12/easily-overload-javascript-functions-with-optional-parameters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joelvanhorn.com/2011/12/12/easily-overload-javascript-functions-with-optional-parameters/</feedburner:origLink></item>
		<item>
		<title>A Super-Charged Version of ICanHaz.js</title>
		<link>http://feedproxy.google.com/~r/JoelVH/~3/kAl48BIjX7Y/</link>
		<comments>http://joelvanhorn.com/2011/12/05/a-super-charged-version-of-icanhaz-js/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 21:36:41 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rembly]]></category>
		<category><![CDATA[Templates]]></category>

		<guid isPermaLink="false">http://joelvanhorn.com/?p=251</guid>
		<description><![CDATA[I&#8217;ve been working on Rembly, which uses Spine.js as the core piece that ties all the functionality together.  I decided to use Mustache.js for my HTML templates.  And finally, I chose ICanHaz.js as a simple and lightweight way of managing my HTML templates. Although ICanHaz.js is a great start, managing my HTML templates became unwieldy because [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://joelvanhorn.com/files/2011/12/blueprint.jpg"><img class="aligncenter size-full wp-image-254" title="Blueprint" src="http://joelvanhorn.com/files/2011/12/blueprint.jpg" alt="Blueprint" width="450" height="299" /></a></p>
<p>I&#8217;ve been working on <a title="Rembly" href="http://www.rembly.com" target="_blank">Rembly</a>, which uses <a title="Spine.js" href="http://maccman.github.com/spine/" target="_blank">Spine.js</a> as the core piece that ties all the functionality together.  I decided to use <a title="Mustache.js" href="http://mustache.github.com/" target="_blank">Mustache.js</a> for my HTML templates.  And finally, I chose <a title="ICanHaz.js" href="http://icanhazjs.com/" target="_blank">ICanHaz.js</a> as a simple and lightweight way of managing my HTML templates.</p>
<p>Although ICanHaz.js is a great start, managing my HTML templates became unwieldy because I started having little templates everywhere.  Each part of a page that is dynamically updated needs to be broken out into its own template.  When you&#8217;ve broken a web page into small parts, it&#8217;s hard to keep track of what it looks like when put back together.  It also becomes hard to create the correct CSS styles when you lose track of the HTML hierarchy.</p>
<p>This lead me to enhance ICanHaz.js with a ton of new features.  The primary one being nested templates, which allowed me to keep my full HTML page template in tact, while designating specific HTML tags as &#8220;sub templates&#8221; or partials. You can also specify additional templates to load and replace script &#8220;include&#8221; tags with the loaded HTML.</p>
<p>Check out <a title="Fork of ICanHaz.js on Github" href="https://github.com/joelvh/ICanHaz.js" target="_blank">my fork on Github</a> for more information about how to use <a title="ICanHaz.js fork on Github" href="https://github.com/joelvh/ICanHaz.js/" target="_blank">my enhanced version if ICanHaz.js</a>. Make sure to <a title="Javascript comments" href="https://github.com/joelvh/ICanHaz.js/blob/master/ICanHaz.js#L47" target="_blank">look at the javascript comments</a> for details. And let me know what you think.</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F05%2Fa-super-charged-version-of-icanhaz-js%2F&amp;counturl=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F05%2Fa-super-charged-version-of-icanhaz-js%2F&amp;count=none&amp;text=A%20Super-Charged%20Version%20of%20ICanHaz.js" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F05%2Fa-super-charged-version-of-icanhaz-js%2F&amp;counturl=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F05%2Fa-super-charged-version-of-icanhaz-js%2F&amp;count=none&amp;text=A%20Super-Charged%20Version%20of%20ICanHaz.js" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F05%2Fa-super-charged-version-of-icanhaz-js%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F05%2Fa-super-charged-version-of-icanhaz-js%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F12%2F05%2Fa-super-charged-version-of-icanhaz-js%2F&amp;title=A%20Super-Charged%20Version%20of%20ICanHaz.js" id="wpa2a_10"><img src="http://joelvanhorn.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><img src="http://feeds.feedburner.com/~r/JoelVH/~4/kAl48BIjX7Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joelvanhorn.com/2011/12/05/a-super-charged-version-of-icanhaz-js/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://joelvanhorn.com/2011/12/05/a-super-charged-version-of-icanhaz-js/</feedburner:origLink></item>
		<item>
		<title>Announcing the ThreatSim Beta</title>
		<link>http://feedproxy.google.com/~r/JoelVH/~3/uLNWl3psF98/</link>
		<comments>http://joelvanhorn.com/2011/06/15/announcing-the-threatsim-beta/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 17:46:55 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://joelvanhorn.com/?p=248</guid>
		<description><![CDATA[I&#8217;ve been working with Stratum Security for the past couple of months on ThreatSim (@ThreatSim), which we are happy to announce to the world today!  ThreatSim is a web-based phishing attack simulator to help companies assess how vulnerable their network and internal assets may be to phishing attacks.  Not only does ThreatSim track who is [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working with <a href="http://www.stratumsecurity.com" target="_blank">Stratum Security</a> for the past couple of months on <a href="http://threatsim.com" target="_blank">ThreatSim</a> (<a href="http://twitter.com/threatsim" target="_blank">@ThreatSim</a>), which we are happy to announce to the world today!  ThreatSim is a web-based phishing attack simulator to help companies assess how vulnerable their network and internal assets may be to phishing attacks.  Not only does ThreatSim track who is clicking on phishing emails, but we&#8217;re also making an exfiltration agent available, which simulates transmitting sensitive data from the local network out to the internet.</p>
<p>Check out the website at <a href="http://www.threatsim.com" target="_blank">www.ThreatSim.com</a>, follow us at <a href="http://twitter.com/threatsim" target="_blank">@ThreatSim</a>, and check out the conversation on <a href="http://news.ycombinator.com/item?id=2657804" target="_blank">Hacker News</a>.</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F06%2F15%2Fannouncing-the-threatsim-beta%2F&amp;counturl=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F06%2F15%2Fannouncing-the-threatsim-beta%2F&amp;count=none&amp;text=Announcing%20the%20ThreatSim%20Beta" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F06%2F15%2Fannouncing-the-threatsim-beta%2F&amp;counturl=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F06%2F15%2Fannouncing-the-threatsim-beta%2F&amp;count=none&amp;text=Announcing%20the%20ThreatSim%20Beta" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F06%2F15%2Fannouncing-the-threatsim-beta%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F06%2F15%2Fannouncing-the-threatsim-beta%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjoelvanhorn.com%2F2011%2F06%2F15%2Fannouncing-the-threatsim-beta%2F&amp;title=Announcing%20the%20ThreatSim%20Beta" id="wpa2a_12"><img src="http://joelvanhorn.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><img src="http://feeds.feedburner.com/~r/JoelVH/~4/uLNWl3psF98" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joelvanhorn.com/2011/06/15/announcing-the-threatsim-beta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joelvanhorn.com/2011/06/15/announcing-the-threatsim-beta/</feedburner:origLink></item>
		<item>
		<title>Using WolframAlpha to Hack Text CAPTCHA</title>
		<link>http://feedproxy.google.com/~r/JoelVH/~3/Zjytu-Rune0/</link>
		<comments>http://joelvanhorn.com/2010/11/10/using-wolframalpha-to-hack-text-captcha/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 18:15:41 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[CAPTCHA]]></category>
		<category><![CDATA[logic]]></category>
		<category><![CDATA[validation]]></category>
		<category><![CDATA[WolframAlpha]]></category>

		<guid isPermaLink="false">http://joelvanhorn.com/?p=227</guid>
		<description><![CDATA[I&#8217;ve been playing around with the Text CAPTCHA demo page and wondered how well WolframAlpha is at logic questions.  As it turns out, Wolfram is pretty smart!  Although, since a CAPTCHA requires an exact answer, some of the results from WolframAlpha are logically correct, but are not exactly correct.  If someone wanted to use WolframAlpha [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing around with the <a href="http://textcaptcha.com/demo" target="_blank">Text CAPTCHA demo page</a> and wondered how well <a href="http://www.wolframalpha.com" target="_blank">WolframAlpha</a> is at logic questions.  As it turns out, Wolfram is pretty smart!  Although, since a CAPTCHA requires an exact answer, some of the results from WolframAlpha are logically correct, but are not exactly correct.  If someone wanted to use WolframAlpha to crack the text CAPTCHA technology, they could build in filters and such to narrow down answers to what the CAPTCHA is likely looking for.</p>
<p>Out of 10 demo questions, <strong>3</strong> failed and <strong>7</strong> were correct (although, 4 had the correct answer but would fail a CAPTCHA if the exact answer was not parsed out).  Here are the results:</p>
<p><strong>Text CAPTCHA:</strong> What is seven hundred and forty four as a number?<br />
<strong> WolframAlpha:</strong> NumberQ[744]<br />
<strong> Result:</strong> <em>ALMOST</em></p>
<p><strong>Text CAPTCHA:</strong> The 7th letter in the word &#8220;central&#8221; is?<br />
<strong> WolframAlpha:</strong> the word<br />
<strong> Result:</strong> <em>FAILED</em></p>
<p><strong>Text CAPTCHA:</strong> Which word in this sentence is all IN capitals?<br />
<strong> WolframAlpha:</strong> capitals IN<br />
<strong> Result:</strong> <em>ALMOST</em></p>
<p><strong>Text CAPTCHA:</strong> Which word contains &#8220;z&#8221; from the list: zoologist, midwifery, spiderweb, crimps?<br />
<strong> WolframAlpha:</strong> zoologist<br />
<strong> Result:</strong> <em>SUCCESS!</em></p>
<p><strong>Text CAPTCHA:</strong> The 2nd colour in purple, yellow, arm, white and blue is?<br />
<strong> WolframAlpha:</strong> yellow<br />
<strong> Result:</strong> <em>SUCCESS!</em></p>
<p><strong>Text CAPTCHA:</strong> Of the numbers seventy six, 2, 50 or forty, which is the lowest?<br />
<strong> WolframAlpha:</strong> or<br />
<strong> Result:</strong> <em>FAILED</em></p>
<p><strong>Text CAPTCHA:</strong> What is the 7th digit in 9686561?<br />
<strong> WolframAlpha:</strong> 1<br />
<strong> Result:</strong> <em>SUCCESS!</em></p>
<p><strong>Text CAPTCHA:</strong> Which of these is a colour: monkey, bank or purple?<br />
<strong> WolframAlpha:</strong> colour purple<br />
<strong> Result:</strong> <em>ALMOST</em></p>
<p><strong>Text CAPTCHA:</strong> The day of the week in chips, house, bank, mouse, trousers or Friday is?<br />
<strong> WolframAlpha:</strong> mouse<br />
<strong> Result:</strong> <em>FAILED</em></p>
<p><strong>Text CAPTCHA:</strong> If a person is called Mary, what is their name?<br />
<strong> WolframAlpha:</strong> called Mary<br />
<strong> Result:</strong> <em>ALMOST</em></p>
<p><a href="http://twitter.com/wolfram_alpha" target="_blank">Wolfram</a>, you&#8217;re close&#8230; keep up the good work!  <a href="http://www.textcaptcha.com" target="_blank">Text CAPTCHA</a>, the demo page was easy.  Are the other questions harder?</p>
<p><strong><em>Update:</em></strong><em> There&#8217;s a <a href="http://news.ycombinator.com/item?id=1891375" target="_blank">discussion going on over at Hacker News</a>, if you want to check it out!</em></p>
<p><strong><em>Update 2:</em><em><span style="font-weight: normal;"> WolframAlpha can generate a CAPTCHA image of each of these text questions, as to make it harder for a bot to decode AND answer the question!  Check it out:  <a href="http://www.wolframalpha.com/input/?i=CAPTCHA+What+is+seven+hundred+and+forty+four+as+a+number%3F" target="_blank">http://www.wolframalpha.com/input/?i=CAPTCHA+What+is+seven+hundred+and+forty+four+as+a+number%3F</a></span></em></strong></p>
<p><em><span style="font-weight: normal;"><strong>Update 3:</strong></span><span style="font-weight: normal;"> There is more <a href="http://www.reddit.com/r/programming/comments/e4jod/using_wolframalpha_to_hack_text_captcha/" target="_blank">discussion going on over at Reddit</a> for you guys looking for more insights&#8230;. <img src='http://joelvanhorn.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </span></em></p>
<p><em><span style="font-weight: normal;"><strong>Update 4:</strong></span><span style="font-weight: normal;"> Looks like someone put together a <a href="http://textcaptchabreaker.appspot.com/" target="_blank">script that knows the format of the Text CAPTCHA questions</a>.  It was <a href="http://news.ycombinator.com/item?id=1897932" target="_blank">posted on Hacker News</a>.</span></em></p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F10%2Fusing-wolframalpha-to-hack-text-captcha%2F&amp;counturl=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F10%2Fusing-wolframalpha-to-hack-text-captcha%2F&amp;count=none&amp;text=Using%20WolframAlpha%20to%20Hack%20Text%20CAPTCHA" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F10%2Fusing-wolframalpha-to-hack-text-captcha%2F&amp;counturl=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F10%2Fusing-wolframalpha-to-hack-text-captcha%2F&amp;count=none&amp;text=Using%20WolframAlpha%20to%20Hack%20Text%20CAPTCHA" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F10%2Fusing-wolframalpha-to-hack-text-captcha%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F10%2Fusing-wolframalpha-to-hack-text-captcha%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F10%2Fusing-wolframalpha-to-hack-text-captcha%2F&amp;title=Using%20WolframAlpha%20to%20Hack%20Text%20CAPTCHA" id="wpa2a_14"><img src="http://joelvanhorn.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><img src="http://feeds.feedburner.com/~r/JoelVH/~4/Zjytu-Rune0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joelvanhorn.com/2010/11/10/using-wolframalpha-to-hack-text-captcha/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		<feedburner:origLink>http://joelvanhorn.com/2010/11/10/using-wolframalpha-to-hack-text-captcha/</feedburner:origLink></item>
		<item>
		<title>I Know Everything About You(r Garbage)</title>
		<link>http://feedproxy.google.com/~r/JoelVH/~3/PdEQnKuzG4k/</link>
		<comments>http://joelvanhorn.com/2010/11/10/i-know-everything-about-your-garbage/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 05:05:28 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[identity]]></category>
		<category><![CDATA[paranoia]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[theft]]></category>

		<guid isPermaLink="false">http://joelvanhorn.com/?p=225</guid>
		<description><![CDATA[Working as a security consultant, I&#8217;ve come to be much more paranoid about my privacy over the years.  One thing that I do is shred anything that has my name on it.  I don&#8217;t need anyone rummaging through my garbage to write my biography or cash in on my identity! I could go on, but why? [...]]]></description>
			<content:encoded><![CDATA[<p>Working as a security consultant, I&#8217;ve come to be much more paranoid about my privacy over the years.  One thing that I do is shred anything that has my name on it.  I don&#8217;t need anyone <a href="http://chetansurpur.com/blog/2010/10/breach-of-privacy.html" target="_blank">rummaging through my garbage to write my biography</a> or cash in on my identity!</p>
<p>I could go on, but why?  <a href="http://chetansurpur.com/blog/2010/10/breach-of-privacy.html" target="_blank">Read about someone else&#8217;s trash&#8230;.</a></p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F10%2Fi-know-everything-about-your-garbage%2F&amp;counturl=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F10%2Fi-know-everything-about-your-garbage%2F&amp;count=none&amp;text=I%20Know%20Everything%20About%20You%28r%20Garbage%29" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F10%2Fi-know-everything-about-your-garbage%2F&amp;counturl=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F10%2Fi-know-everything-about-your-garbage%2F&amp;count=none&amp;text=I%20Know%20Everything%20About%20You%28r%20Garbage%29" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F10%2Fi-know-everything-about-your-garbage%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F10%2Fi-know-everything-about-your-garbage%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F10%2Fi-know-everything-about-your-garbage%2F&amp;title=I%20Know%20Everything%20About%20You%28r%20Garbage%29" id="wpa2a_16"><img src="http://joelvanhorn.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><img src="http://feeds.feedburner.com/~r/JoelVH/~4/PdEQnKuzG4k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joelvanhorn.com/2010/11/10/i-know-everything-about-your-garbage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joelvanhorn.com/2010/11/10/i-know-everything-about-your-garbage/</feedburner:origLink></item>
		<item>
		<title>Change the Way You Sleep, the Way You Work, and the Way You Type</title>
		<link>http://feedproxy.google.com/~r/JoelVH/~3/N_u85fil2j8/</link>
		<comments>http://joelvanhorn.com/2010/11/09/change-the-way-you-sleep-the-way-you-work-and-the-way-you-type/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 04:48:34 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Studies]]></category>
		<category><![CDATA[discipline]]></category>
		<category><![CDATA[human behavior]]></category>
		<category><![CDATA[routine]]></category>

		<guid isPermaLink="false">http://joelvanhorn.com/?p=214</guid>
		<description><![CDATA[I definitely need more discipline in my life, and part of that is getting out of my home office into some real, collaborative office space.  Then I might start working on a routine that takes me more than a couple feet from my bed. But check this out&#8230;. This guy talks about 3 different improvements [...]]]></description>
			<content:encoded><![CDATA[<p>I definitely need more discipline in my life, and part of that is getting out of my home office into some real, collaborative office space.  Then I might start working on a routine that takes me more than a couple feet from my bed.</p>
<p>But check this out&#8230;. <a href="http://chetansurpur.com/blog/2010/11/magic-work-cycle.html" target="_blank">This guy talks about 3 different improvements he&#8217;s made to his daily routine&#8230;.</a> I imagine attempting these might be a good exercise, but I don&#8217;t think I&#8217;m there yet.  But I am impressed.  And I should probably try it one of these days.</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F09%2Fchange-the-way-you-sleep-the-way-you-work-and-the-way-you-type%2F&amp;counturl=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F09%2Fchange-the-way-you-sleep-the-way-you-work-and-the-way-you-type%2F&amp;count=none&amp;text=Change%20the%20Way%20You%20Sleep%2C%20the%20Way%20You%20Work%2C%20and%20the%20Way%20You%20Type" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F09%2Fchange-the-way-you-sleep-the-way-you-work-and-the-way-you-type%2F&amp;counturl=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F09%2Fchange-the-way-you-sleep-the-way-you-work-and-the-way-you-type%2F&amp;count=none&amp;text=Change%20the%20Way%20You%20Sleep%2C%20the%20Way%20You%20Work%2C%20and%20the%20Way%20You%20Type" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F09%2Fchange-the-way-you-sleep-the-way-you-work-and-the-way-you-type%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F09%2Fchange-the-way-you-sleep-the-way-you-work-and-the-way-you-type%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F09%2Fchange-the-way-you-sleep-the-way-you-work-and-the-way-you-type%2F&amp;title=Change%20the%20Way%20You%20Sleep%2C%20the%20Way%20You%20Work%2C%20and%20the%20Way%20You%20Type" id="wpa2a_18"><img src="http://joelvanhorn.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><img src="http://feeds.feedburner.com/~r/JoelVH/~4/N_u85fil2j8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joelvanhorn.com/2010/11/09/change-the-way-you-sleep-the-way-you-work-and-the-way-you-type/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joelvanhorn.com/2010/11/09/change-the-way-you-sleep-the-way-you-work-and-the-way-you-type/</feedburner:origLink></item>
		<item>
		<title>Google Introduces Instant Preview Search Results</title>
		<link>http://feedproxy.google.com/~r/JoelVH/~3/3Xn08yWbDGE/</link>
		<comments>http://joelvanhorn.com/2010/11/09/google-introduces-instant-preview-search-results/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 21:53:02 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://joelvanhorn.com/?p=212</guid>
		<description><![CDATA[I think I&#8217;m a fan of Google&#8217;s Instant Search.  Rather than having to hit &#8220;enter&#8221; or click the &#8220;search&#8221; button, the search results automatically refresh as I type.  It&#8217;s quirky sometimes, because I&#8217;ll see some search results that look accurate as I&#8217;v only typed in a couple letters, and if I&#8217;m typing too fast, it [...]]]></description>
			<content:encoded><![CDATA[<p>I think I&#8217;m a fan of Google&#8217;s Instant Search.  Rather than having to hit &#8220;enter&#8221; or click the &#8220;search&#8221; button, the search results automatically refresh as I type.  It&#8217;s quirky sometimes, because I&#8217;ll see some search results that look accurate as I&#8217;v only typed in a couple letters, and if I&#8217;m typing too fast, it passes me by and it&#8217;s not always easy to back up to to those previous results.  So, for the most part, I like it.</p>
<p><a href="http://googlewebmastercentral.blogspot.com/2010/11/instant-previews.html" target="_blank">Google just introduced Instant Preview</a>, which displays a screenshot of each search result, while highlighting the relevant part of the page that qualified it as a search result.  Convenient for skimming, and could lead to some interesting hacks that websites implement to generate some catchy screenshots that may or may not look the same when you actually click the link.</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F09%2Fgoogle-introduces-instant-preview-search-results%2F&amp;counturl=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F09%2Fgoogle-introduces-instant-preview-search-results%2F&amp;count=none&amp;text=Google%20Introduces%20Instant%20Preview%20Search%20Results" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F09%2Fgoogle-introduces-instant-preview-search-results%2F&amp;counturl=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F09%2Fgoogle-introduces-instant-preview-search-results%2F&amp;count=none&amp;text=Google%20Introduces%20Instant%20Preview%20Search%20Results" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F09%2Fgoogle-introduces-instant-preview-search-results%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F09%2Fgoogle-introduces-instant-preview-search-results%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjoelvanhorn.com%2F2010%2F11%2F09%2Fgoogle-introduces-instant-preview-search-results%2F&amp;title=Google%20Introduces%20Instant%20Preview%20Search%20Results" id="wpa2a_20"><img src="http://joelvanhorn.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><img src="http://feeds.feedburner.com/~r/JoelVH/~4/3Xn08yWbDGE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joelvanhorn.com/2010/11/09/google-introduces-instant-preview-search-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joelvanhorn.com/2010/11/09/google-introduces-instant-preview-search-results/</feedburner:origLink></item>
	</channel>
</rss>

