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

<channel>
	<title>Cognition &#187; pricewatch</title>
	<atom:link href="http://www.cognition.ca/tag/pricewatch/feed" rel="self" type="application/rss+xml" />
	<link>http://www.cognition.ca</link>
	<description>Balls-in-the-air Entrepreneurship and Juggling.</description>
	<lastBuildDate>Thu, 22 Jul 2010 06:34:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How I Built a Free Grid Computer, In Less Than a Week</title>
		<link>http://www.cognition.ca/2008/04/how-to-build-a-free-grid-computer.html</link>
		<comments>http://www.cognition.ca/2008/04/how-to-build-a-free-grid-computer.html#comments</comments>
		<pubDate>Sat, 12 Apr 2008 00:07:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[entrepreneurs]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[bargain]]></category>
		<category><![CDATA[buylater]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[pricewatch]]></category>
		<category><![CDATA[shopping]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[web2.0]]></category>

		<guid isPermaLink="false">http://www.cognition.ca/?p=60</guid>
		<description><![CDATA[By now you&#8217;ve all heard about BuyLater, my happy little firefox extension that (thanks to an unexpected LifeHacker.com article) is rapidly climbing towards 1000 users and world domination. Without getting TOO technical, I thought I would share with you how I saved BuyLater from becoming an infrastructure nightmare &#8211; one that would have either killed [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" style="float: right; border: 0; margin: 20px;" src="http://farm1.static.flickr.com/32/102686300_327fb05079_m.jpg" alt="" width="240" height="160" /></p>
<p>By now you&#8217;ve all heard about <a href="http://buylater.cognition.ca">BuyLater</a>, my happy little firefox extension that (thanks to <a href="http://lifehacker.com/373503/monitor-amazon-products-for-price-drops-and-availability-in-real+time">an unexpected LifeHacker.com article</a>) is rapidly climbing towards 1000 users and world domination. Without getting TOO technical, I thought I would share with you how I saved BuyLater from becoming an infrastructure nightmare &#8211; one that would have either killed the value of the application (real-time updates), or sucked tons of money and hardware into a technology backwash.</p>
<p>This will be a little controversial, I think &#8211; simply because the technique I used, (grid computing), is most often used for less&#8230; legitimate&#8230; purposes. So much so, that it is almost synonymous with &#8220;Bot Nets&#8221;.</p>
<p>But let&#8217;s go back to the beginning.</p>
<p><span id="more-60"></span>When I approached <a href="http://overstimulate.com">Jesse</a> about <a href="http://twitter.com/wiime">WiiMe</a>, and suggested that he ought to generalize it beyond a single product (Wii), and a single interface (Twitter), he told me it would be too hard. The key problem, he pointed out, was keeping a large number of items up-to-date. &#8220;Don&#8217;t you realize <a href="http://www.amazon.com/?tag=boin-20">Amazon</a> has a limit on their API?&#8221;</p>
<p>Well, I <strong>did</strong> realize that. But I also had a few ideas.</p>
<h2>Step 1 &#8211; Do more with Less</h2>
<p>Amazon limits API requests to 1 request per second, a totally reasonable limit for most purposes. However, they enforce that limit based on IP address, NOT based on API key. So getting a bunch of extra API keys and round-robining through them was not going to work. (That was a trick I had used on Google&#8217;s Search API, some years ago.)</p>
<p>However, most people don&#8217;t realize that you can poll for more than one item, per API call. In fact, you can pack 10 items into a single request. Doing this gave me a theoretical maximum of 600 items per minute. When I broke the 300 user mark (somewhere in the first two days), and the total number of items exceeded 600, I had to drop the refresh interval back to 2 minutes. Uh-oh &#8211; I could see where this was going.</p>
<p><img class="alignright" style="float: right; border: 0; margin: 20px;" src="http://farm1.static.flickr.com/100/310446979_dd7ac572f8_m.jpg" alt="" width="240" height="180" />Sure enough, over the course of the next week, I gradually reduced the update interval to 6 minutes &#8211; which meant that BuyLater became essentially useless for tracking Wiis and other scarce items, where the time in-stock is typically 5 minutes or less.</p>
<p>I needed a BUNCH more IP addresses, and quick.</p>
<h2>Step 2 &#8211; With a little help from my friends&#8230;</h2>
<p>Rather than start buying additional servers (which I couldn&#8217;t afford), or additional IP addresses (which I couldn&#8217;t get), I did what any sensible child of the digital age would do &#8211; I made it someone else&#8217;s problem. I simply added a small service to the BuyLater extension &#8211; that fetches a given URL every 60 seconds, and returns the resulting XML data to the BuyLater server. In essence, I distributed the task of polling amazon to the end-users.</p>
<p>Why 60 seconds? Simple math, really. I&#8217;ve always wanted to maintain a 60-second refresh interval for the BuyLater service; most users are following 2 unique items, and as a basic assumption, I assume people have their browser open 20% of the time. (Having users in the UK and, hopefully soon, Asia, helps to spread out the polling). Remember, each query to Amazon fetches 10 items &#8211; which means, hopefully, that the cluster will be able to maintain my target refresh rate&#8230; indefinitely.</p>
<p>Now, obviously I&#8217;ll still need to add some more servers at some point, since all this data is still going back to one place. But at least I&#8217;ll be adding them for the right reasons.</p>
<h2>Step 3 &#8211; ???????</h2>
<p><img class="alignright" style="float: right; border: 0; margin: 20px;" src="http://farm2.static.flickr.com/1204/1326013625_709c02100d_m.jpg" alt="" width="240" height="160" />There are two questions that people have asked me, so far:</p>
<ul>
<li>What do your users think about that?</li>
<li>What does Amazon think about that?</li>
</ul>
<p>To the first one, I have no idea. That&#8217;s really what this post is about &#8211; what DO you think about it? Is it alright for Larry to be fetching data from Amazon, that helps Sally get a deal? Should I have made the whole thing opt-in, or opt-out? From a technical standpoint, BuyLater users were already visiting both Amazon, and the BuyLater site (albeit not once every 60 seconds), and there&#8217;s no personal info in any of this data, so what&#8217;s the difference?</p>
<p>On to the second question &#8211; again, I have no idea. But since there were a couple of @amazon.com email addresses in yesterday&#8217;s batch of users, I imagine if they have a problem with it&#8230; I&#8217;ll hear about it pretty quick.</p>
<span class="akst_link"><a href="http://www.cognition.ca/?p=60&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_60"  class="akst_share_link">Share This</a>
</span>]]></content:encoded>
			<wfw:commentRss>http://www.cognition.ca/2008/04/how-to-build-a-free-grid-computer.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>I Wrote A MashUp, Just for You</title>
		<link>http://www.cognition.ca/2008/03/i-wrote-a-mashup-just-for-you.html</link>
		<comments>http://www.cognition.ca/2008/03/i-wrote-a-mashup-just-for-you.html#comments</comments>
		<pubDate>Sat, 22 Mar 2008 08:15:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[entrepreneurs]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[buylater]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[mashup]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[pricewatch]]></category>
		<category><![CDATA[shopping]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[web2.0]]></category>
		<category><![CDATA[wii]]></category>

		<guid isPermaLink="false">http://www.cognition.ca/2008/03/i-wrote-a-mashup-just-for-you.html</guid>
		<description><![CDATA[If you&#8217;re one of those people who stood in &#8220;The Line&#8221;, then this isn&#8217;t for you. If you get a strange, visceral pleasure in wasting hours, even days, of your life, waiting for your local WalMart to get more Beanie Babies in stock &#8211; then you should stop reading right now. If you like to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://buylater.cognition.ca/"><img src="http://buylater.cognition.ca/logo.png" border="0" alt="" hspace="20" vspace="20" width="346" height="197" align="right" /></a>If you&#8217;re one of those people who stood in &#8220;The Line&#8221;, then this isn&#8217;t for you.</p>
<p>If you get a strange, visceral pleasure in wasting hours, even days, of your life, <em>waiting</em> for your local WalMart to get more Beanie Babies in stock &#8211; then you should stop reading right now.</p>
<p>If you like to revisit your local grocery store <em>every night</em>, just to see if they&#8217;ve dropped the price on those great donuts in aisle 4&#8230; then hit the Back Button, and read something else.</p>
<p>But &#8211; if you have a life, and you still want to try and buy something online &#8211; I might have something that can help.</p>
<p>It&#8217;s called <a href="http://buylater.cognition.ca/">BuyLater</a>, and that&#8217;s exactly what it&#8217;s for &#8211; buying Amazon products, later on.</p>
<p>Later can be: When it&#8217;s back &#8220;In Stock&#8221; (can someone say <strong>Wii</strong>?), or simply when it&#8217;s a little cheaper (or even on sale).</p>
<p>Unlike many of my ideas (which are unique, innovative, and incomprehensible), this one actually isn&#8217;t mine. My buddy <a href="http://overstimulate.com">Jesse Andrews</a> did it first, with a Wii-only bot called <a title="WiiMe" href="http://twitter.com/wiime">WiiMe</a>. I just took the idea, and strreeettched it a little.</p>
<span class="akst_link"><a href="http://www.cognition.ca/?p=52&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_52"  class="akst_share_link">Share This</a>
</span>]]></content:encoded>
			<wfw:commentRss>http://www.cognition.ca/2008/03/i-wrote-a-mashup-just-for-you.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
