<?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>Hungry Machine &#187; Rails</title>
	<atom:link href="http://blog.hungrymachine.com/tag/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hungrymachine.com</link>
	<description>The guys behind LivingSocial</description>
	<lastBuildDate>Sun, 25 Oct 2009 15:08:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ESI &amp; Mongrel-ESI.. Request for Feedback</title>
		<link>http://blog.hungrymachine.com/2008/06/04/esi-mongrel-esi-request-for-feedback/</link>
		<comments>http://blog.hungrymachine.com/2008/06/04/esi-mongrel-esi-request-for-feedback/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 15:59:00 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[esi]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">blog.hungrymachine.com/2008/06/04/esi-mongrel-esi-request-for-feedback</guid>
		<description><![CDATA[
 .thumbnail {  padding:12px; float:right}


    


The Railsconf08 talk on ESI &#038; Rails has sparked some interest in the community, and Todd, the core mongrel-esi maintainer, is asking for feedback on the mongrel-esi mailing list.
 The latest rumor is he is working on a nginx port of mongrel-esi, which I have to [...]]]></description>
			<content:encoded><![CDATA[<style>
 .thumbnail {  padding:12px; float:right}
</style>
<div class="thumbnail">
    <a href="http://blog.hungrymachine.com/assets/2008/5/31/RailsConf08_Assembling-Pages-Last.pdf.zip"><img width="281" height="177" src="http://blog.hungrymachine.com/assets/2008/5/31/Picture_14.png" /></a>
</div>
<div><br/><br/>
<p>The Railsconf08 talk on ESI &#038; Rails has sparked some interest in the community, and Todd, the core <a href="http://code.google.com/p/mongrel-esi/">mongrel-esi</a> maintainer, is asking for feedback on the <a href="http://groups.google.com/group/mongrel-esi">mongrel-esi mailing list</a>.</p>
<p> The latest rumor is he is working on a <a href="http://nginx.net/">nginx</a> port of mongrel-esi, which I have to admit sounds very interesting&#8230;</p>
<p> How are people planning to use ESI? Can anyone provide Todd with some feedback?</p>
</div>
<div style="clear:both"></div>
<pre>
  I'm wondering what is the main set of features preventing folks
today from using mongrel-esi in production?  Is it :

* performance
* documentation
* stability

If it's performance, can someone do some load testing maybe provide
some numbers and even some target numbers?  I am working on an
improved concurrency model, that should help improve page performance
for pages with lots of esi:include tags

if it's documentation, what's the missing bits, and can any of you
help out by filling in the gaps?

if it's stability, can you provide some samples that fail?

-Todd
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.hungrymachine.com/2008/06/04/esi-mongrel-esi-request-for-feedback/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Advanced Rails Recipes</title>
		<link>http://blog.hungrymachine.com/2008/05/13/advanced-rails-recipes/</link>
		<comments>http://blog.hungrymachine.com/2008/05/13/advanced-rails-recipes/#comments</comments>
		<pubDate>Tue, 13 May 2008 16:32:00 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">blog.hungrymachine.com/2008/11/13/advanced-rails-recipes</guid>
		<description><![CDATA[
 .thumbnail {  background:transparent url(http://www.pragprog.com/images/books/190x228/book-shadow.png) no-repeat scroll left top;
                     padding:7px; float:left}


    
  

Congratulations to Mike Clark and the Pragmatic Programmers team for shipping Advanced Rails Recipes.  I highly recommend [...]]]></description>
			<content:encoded><![CDATA[<style>
 .thumbnail {  background:transparent url(http://www.pragprog.com/images/books/190x228/book-shadow.png) no-repeat scroll left top;
                     padding:7px; float:left}
</style>
<div class="thumbnail">
    <a href="http://pragprog.com/titles/fr_arr/advanced-rails-recipes"><img width="190" height="228" title="" src="http://www.pragprog.com/images/covers/190x228/fr_arr.jpg?1194372920" alt="Advanced Rails Recipes: 84 New Ways to Build Stunning Rails Apps"/></a>
  </div>
<div>
<p>Congratulations to Mike Clark and the Pragmatic Programmers team for shipping <a href="http://pragprog.com/titles/fr_arr/advanced-rails-recipes">Advanced Rails Recipes</a>.  I highly recommend this book of 70+ recipes on topics ranging from deployment to UI to security and performance, just to list a few.
<p>Val, Warren and I are honored to have our recipes included.</p>
<div style="padding-left:10px">
<p>Recipe 34: Play Nice with Facebook</p>
<p>Recipe 62: Profile in the Browser</p>
<p>Recipe 67: Encrypt Sensitive Data</p>
</div>
<p>It was a pleasure to work with Mike Clark on this project.  See his screencast below.
<p> <a href="http://videos.pragprog.com/book-related/fr_arr.mov">Advanced Rails Recipes Screencast</a> (33Mb, Quicktime)
</div>
<div style="clear:both"></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.hungrymachine.com/2008/05/13/advanced-rails-recipes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActsAsInsertOrUpdate</title>
		<link>http://blog.hungrymachine.com/2008/04/23/actsasinsertorupdate/</link>
		<comments>http://blog.hungrymachine.com/2008/04/23/actsasinsertorupdate/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 03:40:00 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[activerecord]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">blog.hungrymachine.com/2008/11/13/actsasinsertorupdate</guid>
		<description><![CDATA[Problem

With high volume Rails applications, entities with unique constraints are expensive and error prone to create/update. ActsAsInsertOrUpdate helps solve that problem (if you&#8217;re using MySQL), by leveraging the &#8220;INSERT &#8230; ON DUPLICATE KEY UPDATE&#8221; functionality.

Scenario
 Lets say you have a Person, and Entity, and a Rating. Each user can rate each entity only once, and [...]]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p>
With high volume Rails applications, entities with unique constraints are expensive and error prone to create/update. ActsAsInsertOrUpdate helps solve that problem (if you&#8217;re using MySQL), by leveraging the &#8220;INSERT &#8230; ON DUPLICATE KEY UPDATE&#8221; functionality.
</p>
<h2>Scenario</h2>
<p> Lets say you have a Person, and Entity, and a Rating. Each user can rate each entity only once, and if they re-rate the entity, it should update the value.</p>
<div class="CodeRay">
<div class="code">
<pre><span style="color:#080; font-weight:bold">class</span> <span style="color:#B06; font-weight:bold">Entity</span> &lt; <span style="color:#036; font-weight:bold">ActiveRecord</span>::<span style="color:#036; font-weight:bold">Base</span>
  has_many <span style="color:#A60">:ratings</span>
<span style="color:#080; font-weight:bold">end</span>

<span style="color:#080; font-weight:bold">class</span> <span style="color:#B06; font-weight:bold">Person</span> &lt; <span style="color:#036; font-weight:bold">ActiveRecord</span>::<span style="color:#036; font-weight:bold">Base</span>
 has_many <span style="color:#A60">:ratings</span>
<span style="color:#080; font-weight:bold">end</span>

<span style="color:#080; font-weight:bold">class</span> <span style="color:#B06; font-weight:bold">Rating</span> &lt; <span style="color:#036; font-weight:bold">ActiveRecord</span>::<span style="color:#036; font-weight:bold">Base</span>
 belongs_to <span style="color:#A60"> <img src='http://blog.hungrymachine.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> erson</span>
 belongs_to <span style="color:#A60">:Entity</span>
<span style="color:#080; font-weight:bold">end</span>  </pre>
</div>
</div>
<p>Here is the table that back&#8217;s Rating. Notice the Unique Key constraint on (entity_id, person_id).</p>
<div class="CodeRay">
<div class="code">
<pre>CREATE TABLE `ratings` (
  `id` int(11) NOT NULL auto_increment,
  `rating` tinyint(4) default '0',
  `person_id` int(11) default NULL,
  `entity_id` int(11) default NULL,
  `created_at` datetime default NULL,
  `updated_at` datetime default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `index_ratings_on_entity_id_and_person_id` (`entity_id`,`person_id`),
)</pre>
</div>
</div>
<p>Previously, the logic would be something like:</p>
<ul>
<li>1) Check if a rating exists for the User + Entity</li>
<li>2) If so, update</li>
<li>3) If not, insert</li>
<li>4) rescue the insert in case there is a unqiue constraint error</li>
<li>5) retrieve the record (and/or update with the new rating)</li>
<p>
If the table is MyISAM, Steps 1-5 aren&#8217;t transactionally safe.  If you&#8217;re using InnoDB, and experience heavy volumes of traffic, you&#8217;re prone to Deadlock&#8217;s.  This is even more of a concern is the unique entity is shared across multiple users, as seen with a recent client of ours.
</p>
<h2>Solution:</h2>
<div class="CodeRay">
<div class="code">
<pre><span style="color:#080; font-weight:bold">class</span> <span style="color:#B06; font-weight:bold">Rating</span> &lt; <span style="color:#036; font-weight:bold">ActiveRecord</span>::<span style="color:#036; font-weight:bold">Base</span>
 belongs_to <span style="color:#A60"> <img src='http://blog.hungrymachine.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> erson</span>
 belongs_to <span style="color:#A60">:Entity</span>
 acts_as_insert_or_update <span style="color:#A60">:field_to_update</span> =&gt; <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">rating</span><span style="color:#710">&quot;</span></span>
<span style="color:#080; font-weight:bold">end</span>  </pre>
</div>
</div>
<p>Now Steps 1-5 above become, just one.  Rating.create(..)</p>
<p>In the background, ActsAsInsertOrUpdate overwrites the implementation of ActionRecord:Base#create, to leverage an often unsed feature of MySQL called INSERT &#8230; ON DUPLICATE KEY UPDATE. As configured above, if a duplicate record is found for the unique constraint, the rating field will be updated with the new value. </p>
<h2>Caution</h2>
<p>This is a brute force hack on ActiveRecord::Base#create.  Use at your own risk.</p>
<h2>Code</h2>
<p>Waiting for a rubyforge account.  Will post more info soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hungrymachine.com/2008/04/23/actsasinsertorupdate/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Agressive Timeouts On External API Calls</title>
		<link>http://blog.hungrymachine.com/2008/03/31/agressive-timeouts-on-external-api-calls/</link>
		<comments>http://blog.hungrymachine.com/2008/03/31/agressive-timeouts-on-external-api-calls/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 03:48:00 +0000</pubDate>
		<dc:creator>val</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">blog.hungrymachine.com/2008/05/13/agressive-timeouts-on-external-api-calls</guid>
		<description><![CDATA[One of the challenges with writing a Facebook or Bebo application is staying within a limit it gives you to respond with data before it shows the Application Did Not Respond page to a user. Having a content reach application calling external APIs, like Amazon or YouTube, with response times beyond your control, forces you [...]]]></description>
			<content:encoded><![CDATA[<p>One of the challenges with writing a Facebook or Bebo application is staying within a limit it gives you to respond with data before it shows the <em>Application Did Not Respond</em> page to a user. Having a content reach application calling external APIs, like Amazon or YouTube, with response times beyond your control, forces you to keep such calls short to allow extra time for processing. We usually wrap them in aggressive timeouts with a retry. As an example is this code from the <a href="http://www.pluitsolutions.com/projects/amazon-ecs">Ruby Amazon E-Commerce <span class="caps">REST</span> Service <span class="caps">API</span></a> gem rewritten to limit a single call attempt to two seconds with one more retry.</p>
<p><strong>Original Code</strong></p>
<div class="CodeRay">
<div class="code">
<pre><span style="color:#080; font-weight:bold">module</span> <span style="color:#B06; font-weight:bold">Amazon</span>
  <span style="color:#080; font-weight:bold">class</span> <span style="color:#B06; font-weight:bold">Ecs</span>

    <span style="color:#080; font-weight:bold">def</span> <span style="color:#038; font-weight:bold">self</span>.send_request(opts)
      request_url = prepare_url(opts)

      res = <span style="color:#036; font-weight:bold">Net</span>::<span style="color:#036; font-weight:bold">HTTP</span>.get_response(<span style="color:#036; font-weight:bold">URI</span>::parse(request_url))
      <span style="color:#080; font-weight:bold">unless</span> res.kind_of? <span style="color:#036; font-weight:bold">Net</span>::<span style="color:#036; font-weight:bold">HTTPSuccess</span>
        raise <span style="color:#036; font-weight:bold">Amazon</span>::<span style="color:#036; font-weight:bold">RequestError</span>, <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">HTTP Response: </span><span style="background-color:#fff0f0"><span style="color:#710">#{</span>res.code<span style="color:#710">}</span></span><span style="color:#D20"> </span><span style="background-color:#fff0f0"><span style="color:#710">#{</span>res.message<span style="color:#710">}</span></span><span style="color:#710">&quot;</span></span>
      <span style="color:#080; font-weight:bold">end</span>
      <span style="color:#036; font-weight:bold">Response</span>.new(res.body)
    <span style="color:#080; font-weight:bold">end</span>

  <span style="color:#080; font-weight:bold">end</span>
<span style="color:#080; font-weight:bold">end</span></pre>
</div>
</div>
<p><strong>Modified Code</strong></p>
<div class="CodeRay">
<div class="code">
<pre><span style="color:#080; font-weight:bold">module</span> <span style="color:#B06; font-weight:bold">Amazon</span>
  <span style="color:#080; font-weight:bold">class</span> <span style="color:#B06; font-weight:bold">Ecs</span>

    <span style="color:#080; font-weight:bold">class</span> <span style="color:#B06; font-weight:bold">EmptyResponse</span>
      <span style="color:#080; font-weight:bold">def</span> <span style="color:#06B; font-weight:bold">items</span>; []; <span style="color:#080; font-weight:bold">end</span>
      <span style="color:#080; font-weight:bold">def</span> <span style="color:#06B; font-weight:bold">total_pages</span>; <span style="color:#00D; font-weight:bold">0</span>; <span style="color:#080; font-weight:bold">end</span>
    <span style="color:#080; font-weight:bold">end</span>

    <span style="color:#080; font-weight:bold">def</span> <span style="color:#038; font-weight:bold">self</span>.send_request(opts)

      res = timed_try(request_url, <span style="color:#00D; font-weight:bold">2</span>) <span style="color:#080; font-weight:bold">do</span> |url|

        uri = <span style="color:#036; font-weight:bold">URI</span>::parse(url)
        req = <span style="color:#036; font-weight:bold">Net</span>::<span style="color:#036; font-weight:bold">HTTP</span>.new(uri.host, uri.port)

        <span style="color:#888"># Agressive timeouts</span>
        req.open_timeout = <span style="color:#00D; font-weight:bold">1</span>
        req.read_timeout = <span style="color:#00D; font-weight:bold">2</span>

        req.start { |http| http.request_get(url) }

      <span style="color:#080; font-weight:bold">end</span>

      res.kind_of?(<span style="color:#036; font-weight:bold">Net</span>::<span style="color:#036; font-weight:bold">HTTPSuccess</span>) ? <span style="color:#036; font-weight:bold">Response</span>.new(res.body) : <span style="color:#036; font-weight:bold">EmptyResponse</span>.new

    <span style="color:#080; font-weight:bold">end</span>

private

     <span style="color:#080; font-weight:bold">def</span> <span style="color:#06B; font-weight:bold">timed_try</span>(url, attempts, &amp;block)

       attempt = <span style="color:#00D; font-weight:bold">1</span>
       <span style="color:#080; font-weight:bold">begin</span>
         block.call(url)
       <span style="color:#080; font-weight:bold">rescue</span> <span style="color:#036; font-weight:bold">Timeout</span>::<span style="color:#036; font-weight:bold">Error</span>
         <span style="color:#080; font-weight:bold">if</span> attempt &gt;= attempts
           <span style="color:#036; font-weight:bold">RAILS_DEFAULT_LOGGER</span>.warn <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">[amazon_api] gave up after attempt #</span><span style="background-color:#fff0f0"><span style="color:#710">#{</span> attempt <span style="color:#710">}</span></span><span style="color:#D20"> to get data from </span><span style="background-color:#fff0f0"><span style="color:#710">#{</span> url <span style="color:#710">}</span></span><span style="color:#710">&quot;</span></span>
           <span style="color:#038; font-weight:bold">nil</span>
         <span style="color:#080; font-weight:bold">else</span>
           <span style="color:#036; font-weight:bold">RAILS_DEFAULT_LOGGER</span>.warn <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">[amazon_api] attempt #</span><span style="background-color:#fff0f0"><span style="color:#710">#{</span> attempt <span style="color:#710">}</span></span><span style="color:#D20"> timed out on getting data from </span><span style="background-color:#fff0f0"><span style="color:#710">#{</span> url <span style="color:#710">}</span></span><span style="color:#710">&quot;</span></span>
           attempt += <span style="color:#00D; font-weight:bold">1</span>
           <span style="color:#080; font-weight:bold">retry</span>
         <span style="color:#080; font-weight:bold">end</span>
       <span style="color:#080; font-weight:bold">end</span>

     <span style="color:#080; font-weight:bold">end</span>

  <span style="color:#080; font-weight:bold">end</span>
<span style="color:#080; font-weight:bold">end</span></pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.hungrymachine.com/2008/03/31/agressive-timeouts-on-external-api-calls/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Leverage Rails Resource Routes on Facebook</title>
		<link>http://blog.hungrymachine.com/2008/01/07/leverage-rails-resource-routes-on-facebook/</link>
		<comments>http://blog.hungrymachine.com/2008/01/07/leverage-rails-resource-routes-on-facebook/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 21:57:00 +0000</pubDate>
		<dc:creator>eddie</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[routing]]></category>

		<guid isPermaLink="false">blog.hungrymachine.com/2008/02/16/leverage-rails-resource-routes-on-facebook</guid>
		<description><![CDATA[Since all canvas page views are proxied through POSTs, resource routes were hopelessly broken. The Facebook platform team was kind enough to add a new feature just for us rails folks: a new signed parameter that indicates the original request type (i.e. POST v. GET) against canvas pages.

Here&#8217;s a small patch you can stick at [...]]]></description>
			<content:encoded><![CDATA[<p>Since all canvas page views are proxied through POSTs, resource routes were hopelessly broken. The Facebook platform team was kind enough to add a new feature just for us rails folks: a new signed parameter that indicates the original request type (i.e. POST v. GET) against canvas pages.<br />
<br/><br/><br />
Here&#8217;s a small patch you can stick at the end of environment.rb to restore REST-ful routes.<br />
<br/><br/></p>
<pre class="textmate-source"><span class="source source_ruby"><span class="meta meta_class meta_class_ruby"><span class="keyword keyword_control keyword_control_class keyword_control_class_ruby">class</span> <span class="entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby">ActionController::Routing::RouteSet</span></span>
  <span class="meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">extract_request_environment</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">(</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_ruby">request</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">)</span></span>
    contents <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> request<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>body<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>read
    facebook_method_override <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="constant constant_language constant_language_ruby">nil</span>
    <span class="keyword keyword_control keyword_control_ruby">if</span> contents <span class="keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_ruby">=~</span> <span class="string string_regexp string_regexp_classic string_regexp_classic_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby">/</span>fb_sig_request_method=<span class="string string_regexp string_regexp_group string_regexp_group_ruby"><span class="punctuation punctuation_definition punctuation_definition_group punctuation_definition_group_ruby">(</span><span class="string string_regexp string_regexp_character-class string_regexp_character-class_ruby"><span class="punctuation punctuation_definition punctuation_definition_character-class punctuation_definition_character-class_ruby">[</span>A-Z<span class="punctuation punctuation_definition punctuation_definition_character-class punctuation_definition_character-class_ruby">]</span></span>+<span class="punctuation punctuation_definition punctuation_definition_group punctuation_definition_group_ruby">)</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby">/</span></span>
      facebook_method_override <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="variable variable_other variable_other_readwrite variable_other_readwrite_global variable_other_readwrite_global_pre-defined variable_other_readwrite_global_pre-defined_ruby"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby">$</span>1</span>
    <span class="keyword keyword_control keyword_control_ruby">end</span>
    request<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>body<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>string <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> contents
    <span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_ruby">{</span><span class="meta meta_syntax meta_syntax_ruby meta_syntax_ruby_start-block"> </span><span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>method</span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=&gt;</span> facebook_method_override <span class="keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_ruby">?</span> facebook_method_override<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>downcase<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>intern <span class="punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby">:</span> request<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>method<span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_ruby">}</span>
  <span class="keyword keyword_control keyword_control_ruby">end</span>
<span class="keyword keyword_control keyword_control_ruby">end</span></span></pre>
<p><br/><br />
<b>UPDATE:</b> Here&#8217;s a slightly better implementation that allows the .get? and .post? helpers as well as a few other things to work (thanks Chris Nolan for reminding us to update this blog entry):<br/><br />
<br/></p>
<pre>
ActionController::AbstractRequest.class_eval do
  def request_method_with_facebook_overrides
    @request_method ||= begin
      case
        when parameters[:_method]
          parameters[:_method].downcase.to_sym
        when parameters[:fb_sig_request_method]
          parameters[:fb_sig_request_method].downcase.to_sym
        else
          request_method_without_facebook_overrides
      end
    end
  end
  alias_method_chain :request_method, :facebook_overrides
end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.hungrymachine.com/2008/01/07/leverage-rails-resource-routes-on-facebook/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Super fast IP to lat/lng in Rails</title>
		<link>http://blog.hungrymachine.com/2007/10/22/super-fast-ip-to-lat-lng-in-rails/</link>
		<comments>http://blog.hungrymachine.com/2007/10/22/super-fast-ip-to-lat-lng-in-rails/#comments</comments>
		<pubDate>Mon, 22 Oct 2007 15:33:00 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[geoloc]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">blog.hungrymachine.com/2008/11/13/super-fast-ip-to-lat-lng-in-rails</guid>
		<description><![CDATA[In building the eye candy demo for the Graphing Social conference, I needed a quick way to geo-locate users by IP address.  For Rails, GeoKit is an awesome plugin. It supports a list of providers, and overlays distance calculations, before_filter helpers, all sorts of good stuff.
It uses hostip.info to do IP to lat/lng, using [...]]]></description>
			<content:encoded><![CDATA[<p>In building the <a href="http://blog.hungrymachine.com/2007/10/19/the-importance-of-eye-candy-and-no-not-the-kind-you-re-thinking">eye candy demo</a> for the Graphing Social conference, I needed a quick way to geo-locate users by IP address.  For Rails, <a href="http://geokit.rubyforge.org/">GeoKit</a> is an awesome plugin. It supports a list of providers, and overlays distance calculations, before_filter helpers, all sorts of good stuff.<br/></p>
<p>It uses <a href="http://www.hostip.info/">hostip.info</a> to do IP to lat/lng, using their RESTful interface:</p>
<div class="CodeRay">
<div class="code">
<pre>http<span style="color:#A60">:/</span>/api.hostip.info/get_html.php?ip=<span style="color:#60E; font-weight:bold">12.215</span>.<span style="color:#60E; font-weight:bold">42.19</span>&amp;position=<span style="color:#038; font-weight:bold">true</span>
  <span style="color:#036; font-weight:bold">Country</span>: <span style="color:#036; font-weight:bold">UNITED</span> <span style="color:#036; font-weight:bold">STATES</span> (<span style="color:#036; font-weight:bold">US</span>)
  <span style="color:#036; font-weight:bold">City</span>: <span style="color:#036; font-weight:bold">Sugar</span> <span style="color:#036; font-weight:bold">Grove</span>, <span style="color:#036; font-weight:bold">IL</span>
  <span style="color:#036; font-weight:bold">Latitude</span>: <span style="color:#60E; font-weight:bold">41.7696</span>
  <span style="color:#036; font-weight:bold">Longitude</span>: <span style="color:#60E; font-weight:bold">-88.4588</span></pre>
</div>
</div>
<p><br/><br />
This is great, but its just too darn slow to geolocate 12 users a second. All I needed was a FAST ip to lat/long lookup mechanism. Luckily, HostInfo provides the raw data. Here&#8217;s how I built super fast GeoLoc by IP method.<br />
<br/><br/><br />
Download, create a DB, and import the data.</p>
<div class="CodeRay">
<div class="code">
<pre>wget http<span style="color:#A60">:/</span>/hostip.ww.com/hostip_current.sql.gz
gunzip hostip_current.sql.gz
mysqladmin -uroot create hostip
mysql -uroot hostip &lt; hostip_current.sql</pre>
</div>
</div>
<p><br/><br/><br />
Create a simple HostIp class.  Note:  I need to dynamically build this query b/c the data is sharded across tables by the A class of the IP.</p>
<div class="CodeRay">
<div class="code">
<pre><span style="color:#080; font-weight:bold">class</span> <span style="color:#B06; font-weight:bold">Hostip</span> &lt; <span style="color:#036; font-weight:bold">ActiveRecord</span>::<span style="color:#036; font-weight:bold">Base</span>
  <span style="color:#080; font-weight:bold">def</span> <span style="color:#038; font-weight:bold">self</span>.geocode(ip)
    a,b,c,d = ip.split(<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">.</span><span style="color:#710">&quot;</span></span>)
    <span style="color:#038; font-weight:bold">self</span>.set_table_name <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">hostip.ip4_</span><span style="background-color:#fff0f0"><span style="color:#710">#{</span>a<span style="color:#710">}</span></span><span style="color:#710">&quot;</span></span>
    ip = find(<span style="color:#A60">:first</span>, <span style="color:#A60">:select</span> =&gt; <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">lat,lng</span><span style="color:#710">&quot;</span></span>,
                <span style="color:#A60">:joins</span> =&gt; <span style="background-color:#fff0f0"><span style="color:#710">%Q{</span><span style="color:#D20">INNER JOIN hostip.cityByCountry
                               ON hostip.ip4_</span><span style="background-color:#fff0f0"><span style="color:#710">#{</span>a<span style="color:#710">}</span></span><span style="color:#D20">.city = hostip.cityByCountry.city
                               AND hostip.ip4_</span><span style="background-color:#fff0f0"><span style="color:#710">#{</span>a<span style="color:#710">}</span></span><span style="color:#D20">.country = hostip.cityByCountry.country</span><span style="color:#710">}</span></span>,
                <span style="color:#A60">:conditions</span> =&gt; [<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">b = ? and c = ?</span><span style="color:#710">&quot;</span></span>, b,c])
    <span style="color:#080; font-weight:bold">if</span> ip
      [ip.lat, ip.lng]
    <span style="color:#080; font-weight:bold">else</span>
      [<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#710">&quot;</span></span>,<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#710">&quot;</span></span>]
    <span style="color:#080; font-weight:bold">end</span>
  <span style="color:#080; font-weight:bold">end</span>
<span style="color:#080; font-weight:bold">end</span> </pre>
</div>
</div>
<p><br/><br/></p>
<p>Usage</p>
<div class="CodeRay">
<div class="code">
<pre>&gt;&gt; <span style="color:#036; font-weight:bold">Hostip</span>.geocode(<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">4.2.2.2</span><span style="color:#710">&quot;</span></span>)
=&gt; [<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">39.944</span><span style="color:#710">&quot;</span></span>, <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">-105.062</span><span style="color:#710">&quot;</span></span>]</pre>
</div>
</div>
<p><br/><br/></p>
<p>Thats it!  Now you can geolocate by IP in your own datacenter.  <br/><br />
Thanks again to the guys at HostIp for sharing this data!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hungrymachine.com/2007/10/22/super-fast-ip-to-lat-lng-in-rails/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Reconfiguring the whole rails stack via a central YAML file</title>
		<link>http://blog.hungrymachine.com/2007/08/20/reconfiguring-the-whole-rails-stack-via-a-central-yaml-file/</link>
		<comments>http://blog.hungrymachine.com/2007/08/20/reconfiguring-the-whole-rails-stack-via-a-central-yaml-file/#comments</comments>
		<pubDate>Mon, 20 Aug 2007 02:07:00 +0000</pubDate>
		<dc:creator>val</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Ops]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[yaml]]></category>

		<guid isPermaLink="false">blog.hungrymachine.com/2007/08/23/reconfiguring-the-whole-rails-stack-via-a-central-yaml-file</guid>
		<description><![CDATA[The challenge with hosting of multiple Rails-based Facebook applications is that the amount of users grow quickly. To address this problem we are using EC2 nodes that we can expand/shrink as the demand grows. The price/performance ratio isn&#8217;t quite what we first expected, so we are moving toward having a few dedicated boxes instead. Another [...]]]></description>
			<content:encoded><![CDATA[<p>The challenge with hosting of multiple Rails-based Facebook applications is that the amount of users grow quickly. To address this problem we are using <span class="caps">EC2</span> nodes that we can expand/shrink as the demand grows. The price/performance ratio isn&#8217;t quite what we first expected, so we are moving toward having a few dedicated boxes instead. Another problem that we add at least a couple of applications a week. On each box that hosts them, we need to reconfigure monit, haproxy, nginx, logrotate and nagios.</p>
<p>To mitigate both issues on dedicated boxes, we resolved to have a central configuration definition in svn with individual box configurations keyed on localhost name. A ruby script regenerates all those aforementioned configuration files from <span class="caps">ERB</span>-processed templates when it is run on a box and bounces the services. A sample config looks like:</p>
<div class="CodeRay">
<div class="code">
<pre>dedicated<span style="color:#00D; font-weight:bold">-1</span>:

    description: <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">The dedicated box #1</span><span style="color:#710">&quot;</span></span>
    ip: <span style="color:#60E; font-weight:bold">64.233</span>.<span style="color:#60E; font-weight:bold">167.99</span>
    failover: dedicated<span style="color:#00D; font-weight:bold">-2</span>

    apps:

        bookshelf:
            port: <span style="color:#00D; font-weight:bold">5000</span>
            instances: <span style="color:#00D; font-weight:bold">20</span>
            response: <span style="color:#036; font-weight:bold">Book</span>

        ljconnect:
            port: <span style="color:#00D; font-weight:bold">6000</span>
            instances: <span style="color:#00D; font-weight:bold">7</span>
            virtual: ljconnect.hungrymachine.com
            response: <span style="color:#036; font-weight:bold">Journal</span>
                      </pre>
</div>
</div>
<p>That definition would generate a monit config with 20 instances of the <em>bookshelf</em> application and 7 instances of the <em>ljconnect</em> application plus all other configurations (including nagios health checks expecting the <em>response</em> value) . It is all possible because we adopt a fixed application deployment file structure and port numbering conventions (via offsets) for all servers.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hungrymachine.com/2007/08/20/reconfiguring-the-whole-rails-stack-via-a-central-yaml-file/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using mocks at the early stage of FB app development</title>
		<link>http://blog.hungrymachine.com/2007/08/15/using-mocks-at-the-early-stage-of-fb-app-development/</link>
		<comments>http://blog.hungrymachine.com/2007/08/15/using-mocks-at-the-early-stage-of-fb-app-development/#comments</comments>
		<pubDate>Wed, 15 Aug 2007 12:50:00 +0000</pubDate>
		<dc:creator>val</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[mock]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">blog.hungrymachine.com/2007/08/23/using-mocks-at-the-early-stage-of-fb-app-development</guid>
		<description><![CDATA[Developing applications for Facebook is a pain. The tunnel approach helps a lot to ease that pain but even then I prefer to start a FB app as a regular application, polish the logic, and then convert it to the Facebook one by adding FBML and such. At the early stages of the development I [...]]]></description>
			<content:encoded><![CDATA[<p>Developing applications for Facebook is a pain. <a href="http://rfacebook.rubyforge.org/tunnel.html">The tunnel approach</a> helps a lot to ease that pain but even then I prefer to start a FB app as a regular application, polish the logic, and then convert it to the Facebook one by adding <span class="caps">FBML</span> and such. At the early stages of the development I have the <em>mocked</em> parameter in <em>config/facebook.yml</em> set to <strong>true</strong> and keep this code in <em>config/initializers/facebook.rb</em>:</p>
<div class="CodeRay">
<div class="code">
<pre><span style="color:#036; font-weight:bold">PERSON_PROFILE_URL</span> = <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">http://www.facebook.com/profile.php</span><span style="color:#710">&quot;</span></span>

<span style="color:#036; font-weight:bold">FACEBOOK_CONFIG</span> = <span style="color:#036; font-weight:bold">YAML</span>.load_file(<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="background-color:#fff0f0"><span style="color:#710">#{</span><span style="color:#036; font-weight:bold">RAILS_ROOT</span><span style="color:#710">}</span></span><span style="color:#D20">/config/facebook.yml</span><span style="color:#710">&quot;</span></span>)[<span style="color:#036; font-weight:bold">RAILS_ENV</span>] || {}

<span style="color:#080; font-weight:bold">if</span> <span style="color:#036; font-weight:bold">FACEBOOK_CONFIG</span>[<span style="background-color:#fff0f0"><span style="color:#710">'</span><span style="color:#D20">mocked</span><span style="color:#710">'</span></span>]

  <span style="color:#080; font-weight:bold">class</span> <span style="color:#B06; font-weight:bold">Facebook::FBMLController</span>

    require <span style="background-color:#fff0f0"><span style="color:#710">'</span><span style="color:#D20">ostruct</span><span style="color:#710">'</span></span>
    <span style="color:#036; font-weight:bold">FB_SESSION</span> = <span style="color:#036; font-weight:bold">OpenStruct</span>.new(<span style="color:#A60">:session_user_id</span> =&gt; <span style="color:#00D; font-weight:bold">1</span>, <span style="color:#A60">:session_key</span> =&gt; <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">12345</span><span style="color:#710">&quot;</span></span>, <span style="color:#A60">:is_valid?</span> =&gt; <span style="color:#038; font-weight:bold">true</span>)

    <span style="color:#080; font-weight:bold">def</span> <span style="color:#06B; font-weight:bold">fbsession</span>; <span style="color:#036; font-weight:bold">FB_SESSION</span>; <span style="color:#080; font-weight:bold">end</span>

    <span style="color:#080; font-weight:bold">def</span> <span style="color:#06B; font-weight:bold">require_facebook_install</span>; <span style="color:#038; font-weight:bold">true</span>; <span style="color:#080; font-weight:bold">end</span>

    <span style="color:#080; font-weight:bold">def</span> <span style="color:#06B; font-weight:bold">redirect_to</span>(url); <span style="color:#080; font-weight:bold">super</span>; <span style="color:#080; font-weight:bold">end</span>

    <span style="color:#080; font-weight:bold">def</span> <span style="color:#06B; font-weight:bold">url_for</span>(*params); <span style="color:#080; font-weight:bold">super</span>; <span style="color:#080; font-weight:bold">end</span>

  <span style="color:#080; font-weight:bold">end</span>

  <span style="color:#080; font-weight:bold">module</span> <span style="color:#B06; font-weight:bold">Facebook::Acts::FbUser</span>
    <span style="color:#080; font-weight:bold">module</span> <span style="color:#B06; font-weight:bold">InstanceMethods</span>
      <span style="color:#080; font-weight:bold">def</span> <span style="color:#06B; font-weight:bold">friends</span>
        (<span style="color:#038; font-weight:bold">self</span>.class.find(<span style="color:#A60">:all</span>) - [ <span style="color:#038; font-weight:bold">self</span> ]).collect(&amp;<span style="color:#A60">:uid</span>)
      <span style="color:#080; font-weight:bold">end</span>
    <span style="color:#080; font-weight:bold">end</span>
  <span style="color:#080; font-weight:bold">end</span>

<span style="color:#080; font-weight:bold">end</span></pre>
</div>
</div>
<p>It mocks out just enough of <a href="http://code.google.com/p/facebook-rails/">Facebook on Rails</a> functionality to use <em>FBMLController</em> and <em>acts_as_fb_user</em> from the beginning without Facebook backend.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hungrymachine.com/2007/08/15/using-mocks-at-the-early-stage-of-fb-app-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Routing to the initial action after facebook application install</title>
		<link>http://blog.hungrymachine.com/2007/08/14/routing-to-the-initial-action-after-facebook-application-install/</link>
		<comments>http://blog.hungrymachine.com/2007/08/14/routing-to-the-initial-action-after-facebook-application-install/#comments</comments>
		<pubDate>Tue, 14 Aug 2007 23:17:00 +0000</pubDate>
		<dc:creator>val</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">blog.hungrymachine.com/2007/08/17/routing-to-the-initial-action-after-facebook-application-install</guid>
		<description><![CDATA[Some facebook applications might have multiple entries. For example, a user might be adding an application (action &#8211; new) or replying to an invitation (action &#8211; reply, param &#8211; id). Since the UI for Facebook application configuration allows to provide only static Post-Add URL it might seem like there is no way to route users [...]]]></description>
			<content:encoded><![CDATA[<p>Some facebook applications might have multiple entries. For example, a user might be adding an application (action &#8211; <em>new</em>) or replying to an invitation (action &#8211; <em>reply</em>, param &#8211; <em>id</em>). Since the UI for Facebook application configuration allows to provide only static <em>Post-Add <span class="caps">URL</span></em> it might seem like there is no way to route users back to the original action if they tried to reach when the application has not been installed for them. Luckily, we have full control on the destination via the <em>next</em> paramater of the post install <span class="caps">URL</span>. All we need is to build a <span class="caps">URL</span> using the incoming call parameters with the exclusion of Facebook-specific ones.</p>
<p>This is an example for <a href="http://code.google.com/p/facebook-rails/">Facebook on Rails</a> based code that might go to the application controller:</p>
<div class="CodeRay">
<div class="code">
<pre><span style="color:#080; font-weight:bold">class</span> <span style="color:#B06; font-weight:bold">ApplicationController</span> &lt; <span style="color:#036; font-weight:bold">Facebook</span>::<span style="color:#036; font-weight:bold">FBMLController</span>

protected

  before_filter <span style="color:#A60">:require_facebook_install</span>

  <span style="color:#080; font-weight:bold">def</span> <span style="color:#06B; font-weight:bold">require_facebook_install</span>
    <span style="color:#080; font-weight:bold">if</span> in_canvas? &amp;&amp; !fbsession.is_valid?
      redirect_to fbsession.get_install_url(<span style="color:#A60">:next</span> =&gt; url_for(post_install_params))
      <span style="color:#038; font-weight:bold">false</span>
    <span style="color:#080; font-weight:bold">end</span>
  <span style="color:#080; font-weight:bold">end</span>

  <span style="color:#080; font-weight:bold">def</span> <span style="color:#06B; font-weight:bold">post_install_params</span>
    params.merge(<span style="color:#A60">:init</span> =&gt; <span style="color:#038; font-weight:bold">true</span>).delete_if { |k, v| k.starts_with?(<span style="background-color:#fff0f0"><span style="color:#710">'</span><span style="color:#D20">fb_sig</span><span style="color:#710">'</span></span>) }
  <span style="color:#080; font-weight:bold">end</span>

<span style="color:#080; font-weight:bold">end</span></pre>
</div>
</div>
<p>Notice that the code sets the <em>init</em> parameter so it <a href="indentifying-users-who-just-installed-your-facebook-apps">can be used to identify a post install call</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hungrymachine.com/2007/08/14/routing-to-the-initial-action-after-facebook-application-install/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Indentifying users who just installed your facebook apps</title>
		<link>http://blog.hungrymachine.com/2007/08/14/indentifying-users-who-just-installed-your-facebook-apps/</link>
		<comments>http://blog.hungrymachine.com/2007/08/14/indentifying-users-who-just-installed-your-facebook-apps/#comments</comments>
		<pubDate>Tue, 14 Aug 2007 23:13:00 +0000</pubDate>
		<dc:creator>val</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">blog.hungrymachine.com/2007/08/24/indentifying-users-who-just-installed-your-facebook-apps</guid>
		<description><![CDATA[Sometimes it is useful to do some action on a Facebook user right after your application has been installed by the user. For example, you might want to push some default FBML to user&#8217;s profile in case he does not complete the action you expect him to do after installation. Facebook application configuration allows to [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it is useful to do some action on a Facebook user right after your application has been installed by the user. For example, you might want to push some default <span class="caps">FBML</span> to user&#8217;s profile in case he does not complete the action you expect him to do after installation. Facebook application configuration allows to provide <em>Post-Add <span class="caps">URL</span></em> to route users to the destination url after the application install. It could be a dedicated <em>post_add</em> action or, in case of a default action where you have some code in the controller and since Facebook limits amount of redirects you can use, it could be a parameter to the url, like <code>&#38;init=true</code>, used to identify that it was a post-install action and execute on it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hungrymachine.com/2007/08/14/indentifying-users-who-just-installed-your-facebook-apps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
