<?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>Schadenfreude &#187; amazon</title>
	<atom:link href="http://www.ralree.com/tag/amazon/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ralree.com</link>
	<description>Malicious enjoyment derived from observing someone else's misfortune</description>
	<lastBuildDate>Sun, 28 Feb 2010 04:18:37 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>OSCON Sessions, Day 2</title>
		<link>http://www.ralree.com/2008/07/25/oscon-sessions-day-2/</link>
		<comments>http://www.ralree.com/2008/07/25/oscon-sessions-day-2/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 13:44:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[beer]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[hadoop]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[oscon]]></category>
		<category><![CDATA[oscon2008]]></category>
		<category><![CDATA[politics]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[swig]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2008/07/25/oscon-sessions-day-2</guid>
		<description><![CDATA[Oh man, what a day.  
I attended quite a few talks, grabbed a lot of swag, and entered a few contests.  I ended up buying the Arduino Starter Kit from MAKE so I can do some awesome embedded Ruby like I saw at FOSCON.  It looks really fun &#8211; I can&#8217;t wait [...]]]></description>
			<content:encoded><![CDATA[<p>Oh man, what a day.  </p>
<p>I attended quite a few talks, grabbed a lot of swag, and entered a few contests.  I ended up buying the <a href="http://www.makershed.com/ProductDetails.asp?ProductCode=MSAK">Arduino Starter Kit from MAKE</a> so I can do some awesome <a href="http://rad.rubyforge.org/">embedded Ruby</a> like I saw at FOSCON.  It looks really fun &#8211; I can&#8217;t wait to try it out.</p>
<p>The talks I attended were half-way decent, but I learned a lot more on the first day.</p>
<h2><a href="http://github.com/hank/life/tree/master/oscon/2008/sessions/Hadoop.EC2.rdoc">Hadoop and EC2</a></h2>
<p>A good overview of how one can use Amazon&#8217;s S3 and EC2 services to cheaply process and store data on a pretty large scale.  The New York Times digitized hundreds of years of articles in <em>a single day</em> using these services and some awesome C++ code.</p>
<h2><a href="http://github.com/hank/life/tree/master/oscon/2008/sessions/Open.Standards.Cloud.Computing.rdoc">Open standards in cloud computing</a></h2>
<p>This ended up being a marketing talk.  I don&#8217;t know what it had to do with cloud computing, and I didn&#8217;t stick around to find out.</p>
<h2><a href="http://github.com/hank/life/tree/master/oscon/2008/sessions/Ruby.1.9.rdoc">Ruby 1.9: What to Expect</a></h2>
<p>An awesome overview of all the new stuff in Ruby 1.9 given by Sam Ruby.  I had no idea they were changing so much, and this was a good dive with code examples into that.  There was some discussion among everyone in the middle on whether <code>for</code> loops should work like <code>.each</code> blocks with regards to scope.  I happen to disagree with what ended up being the popular thought on this subject.  Most were advocating that a <code>for</code> loop constitutes a block, and that scope variables and iterators should be localized inside of it.  This is contrary to almost every language, which I brought up using the example of C.  Yet, when you iterate with <code>.each</code>, you immediately define a block and a scoped iterator, which, if it has a conflicting name with the outside world, it doesn&#8217;t matter since that&#8217;s out of scope.  The only thing this changes is the value of a variable outside after the loop finishes.  I think leaving the ability to modify a variable external to the loop is very convenient &#8211; in summary, <em>leave it how you&#8217;ve done it in Ruby 1.9 already</em>.</p>
<h2><a href="http://github.com/hank/life/tree/master/oscon/2008/sessions/Mobile.rdoc">Ubuntu on the Go: Subnotebook and MID technologies</a></h2>
<p>This was an interesting session on where Canonical is taking mobile technology, and what the community can do to help.  They seem to have a pretty neat subnotebook coming out soon.</p>
<h2><a href="http://github.com/hank/life/tree/master/oscon/2008/sessions/SWIG.rdoc">Python, C++, and SWIG</a></h2>
<p>This could have been one of the best talks, but the speed at which it was given and the lack of enthusiasm in the presentation left most of us either bored or unfulfilled at the end of the talk.  He spent the first half explaining what Python and C++ were, then he got to what SWIG is.  The end was a quick dive into an extremely complicated bunch of files that didn&#8217;t help very much.  In the future, it would be helpful to go to a SWIG talk that details <em>how to make a simple Python extension with SWIG</em>.  I may have to throw that one together myself&#8230;</p>
<p>I also attended the tail end of <a href="http://en.oreilly.com/oscon2008/public/schedule/detail/2872">Designing Political Web Apps for MoveOn.org</a>, but I didn&#8217;t take any notes.  </p>
<p>We ended up going to dinner at <a href="http://www.widmer.com/Default.aspx">Widmer Brothers</a>, which was pretty awesome.  I had the Pork Schnitzel, a very tender piece of meat if I do say so myself, along with 2 Full Nelson IPAs.  Afterwards, we caught the bus from the convention center to BeerForge and the SourceForge Community Choice Awards party.  Beerforge was a blast.  I ended up talking to <a href="http://www.jbkempf.com/">Jean-Baptiste Kempf</a>, one of the developers of VLC, for hours &#8211; a truly great guy.  I learned a lot about France and the French people, but also about VLC.  Apparently, you can use VLC from the command line much like mplayer, which I did not know.  Yet, he explained that they removed Directshow support from VLC in Linux in favor of open source alternatives, which in part I can understand.  Yet, the only codec available that is able to smoothly play 1080p h264 video is closed source (<a href="http://www.coreavc.com/">CoreAVC</a>), and until the ffmpeg avc codec catches up, I&#8217;ll have to continue using mplayer.  When I can play everything back smoothly with VLC, I may consider switching.</p>
<p>The beer at BeerForge was pretty good &#8211; I had the IPA.  SourceForge had some sort of mixed drink which wasn&#8217;t too great.  All in all, a good day, but now I&#8217;m dehydrated&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2008/07/25/oscon-sessions-day-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Parsing Amazon with Hpricot</title>
		<link>http://www.ralree.com/2006/07/06/parsing-amazon-with-hpricot/</link>
		<comments>http://www.ralree.com/2006/07/06/parsing-amazon-with-hpricot/#comments</comments>
		<pubDate>Thu, 06 Jul 2006 01:07:34 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[hpricot]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[_why]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2007/10/13/parsing-amazon-with-hpricot</guid>
		<description><![CDATA[_why made a really sweet HTML parser called Hpricot.   This allows you to easily parse a remote document using Open-URI.  Here&#8217;s how to do it:



require 'rubygems'
require_gem 'hpricot'
require 'open-uri'
puts &#34;Grabbing Page...&#34;
html = open(&#34;http://www.amazon.com/gp/product/1844300439/ref=amb_cob_bh_194691301/002-0086113-2532879?n=283155&#34;)
puts &#34;Parsing...&#34;
doc = Hpricot.parse(html)
(doc.search(&#34;//table//td[@id='prodImageCell']&#34;)/:img).each do &#124;link&#124;
  p link.attributes
end






{&#34;src&#34;=&#62;&#34;http://ec1.images-amazon.com/images/P/1844300439.01._AA240_SCLZZZZZZZ_V54614147_.jpg&#34;, &#34;border&#34;=&#62;&#34;0&#34;, &#34;id&#34;=&#62;&#34;prodImage&#34;, &#34;height&#34;=&#62;&#34;240&#34;, &#34;alt&#34;=&#62;&#34;Cobblers&#34;, &#34;width&#34;=&#62;&#34;240&#34;}




ruby -rrubygems -ropen-uri -e "require 'hpricot';(Hpricot.parse(open('http://www.amazon.com/gp/product/1844300439/ref=amb_cob_bh_194691301/002-0086113-2532879?n=283155')).search(\"//table//td[@id='prodImageCell']\")/:img).each {&#124;link&#124; p [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://redhanded.hobix.com">_why</a> made a really sweet HTML parser called <a href="http://redhanded.hobix.com/inspect/okayGiveHpricot02AGo.html">Hpricot</a>.   This allows you to easily parse a remote document using Open-URI.  Here&#8217;s how to do it:</p>
<div class="CodeRay">
<div class="code">
<pre><code>
require <span class="s"><span class="dl">'</span><span class="k">rubygems</span><span class="dl">'</span></span>
require_gem <span class="s"><span class="dl">'</span><span class="k">hpricot</span><span class="dl">'</span></span>
require <span class="s"><span class="dl">'</span><span class="k">open-uri</span><span class="dl">'</span></span>
puts <span class="s"><span class="dl">&quot;</span><span class="k">Grabbing Page...</span><span class="dl">&quot;</span></span>
html = open(<span class="s"><span class="dl">&quot;</span><span class="k">http://www.amazon.com/gp/product/1844300439/ref=amb_cob_bh_194691301/002-0086113-2532879?n=283155</span><span class="dl">&quot;</span></span>)
puts <span class="s"><span class="dl">&quot;</span><span class="k">Parsing...</span><span class="dl">&quot;</span></span>
doc = <span class="co">Hpricot</span>.parse(html)
(doc.search(<span class="s"><span class="dl">&quot;</span><span class="k">//table//td[@id='prodImageCell']</span><span class="dl">&quot;</span></span>)/<span class="sy">:img</span>).each <span class="r">do</span> |link|
  p link.attributes
<span class="r">end</span>
</code></pre>
</div>
</div>
<div class="CodeRay">
<div class="code">
<pre><code>
{<span class="s"><span class="dl">&quot;</span><span class="k">src</span><span class="dl">&quot;</span></span>=&gt;<span class="s"><span class="dl">&quot;</span><span class="k">http://ec1.images-amazon.com/images/P/1844300439.01._AA240_SCLZZZZZZZ_V54614147_.jpg</span><span class="dl">&quot;</span></span>, <span class="s"><span class="dl">&quot;</span><span class="k">border</span><span class="dl">&quot;</span></span>=&gt;<span class="s"><span class="dl">&quot;</span><span class="k">0</span><span class="dl">&quot;</span></span>, <span class="s"><span class="dl">&quot;</span><span class="k">id</span><span class="dl">&quot;</span></span>=&gt;<span class="s"><span class="dl">&quot;</span><span class="k">prodImage</span><span class="dl">&quot;</span></span>, <span class="s"><span class="dl">&quot;</span><span class="k">height</span><span class="dl">&quot;</span></span>=&gt;<span class="s"><span class="dl">&quot;</span><span class="k">240</span><span class="dl">&quot;</span></span>, <span class="s"><span class="dl">&quot;</span><span class="k">alt</span><span class="dl">&quot;</span></span>=&gt;<span class="s"><span class="dl">&quot;</span><span class="k">Cobblers</span><span class="dl">&quot;</span></span>, <span class="s"><span class="dl">&quot;</span><span class="k">width</span><span class="dl">&quot;</span></span>=&gt;<span class="s"><span class="dl">&quot;</span><span class="k">240</span><span class="dl">&quot;</span></span>}
</code></pre>
</div>
</div>
<pre><code>
ruby -rrubygems -ropen-uri -e "require 'hpricot';(Hpricot.parse(open('http://www.amazon.com/gp/product/1844300439/ref=amb_cob_bh_194691301/002-0086113-2532879?n=283155')).search(\"//table//td[@id='prodImageCell']\")/:img).each {|link| p link.attributes }"
</code></pre>
<p>Amazing stuff really.  The parser is so amazingly fast.  All the time is spent fetching the page, not parsing!</p>
<p>Also, &#8220;Sunset, Sunrise&#8221; by Razor Ramon is awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2006/07/06/parsing-amazon-with-hpricot/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.337 seconds -->
