<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -17,23 +17,24 @@ helpers do
     end
   end
   # fancy time
-  def time_ago_or_time_stamp(from_time, to_time = Time.now, include_seconds = true, detail = false)
+  def relative_time(from_time, to_time = Time.now, include_seconds = true, detail = false)
     from_time = from_time.to_time if from_time.respond_to?(:to_time)
     to_time = to_time.to_time if to_time.respond_to?(:to_time)
     distance_in_minutes = (((to_time - from_time).abs)/60).round
     distance_in_seconds = ((to_time - from_time).abs).round
     case distance_in_minutes
-      when 0..1           then time = (distance_in_seconds &lt; 60) ? &quot;#{distance_in_seconds} seconds ago&quot; : '1 minute ago'
-      when 2..59          then time = &quot;#{distance_in_minutes} minutes ago&quot;
-      when 60..90         then time = &quot;1 hour ago&quot;
-      when 90..1440       then time = &quot;#{(distance_in_minutes.to_f / 60.0).round} hours ago&quot;
-      when 1440..2160     then time = '1 day ago' # 1-1.5 days
-      when 2160..2880     then time = &quot;#{(distance_in_minutes.to_f / 1440.0).round} days ago&quot; # 1.5-2 days
-      else time = from_time.strftime(&quot;%a, %d %b %Y&quot;)
+      when 0..1 then time = (distance_in_seconds &lt; 60) ? &quot;#{distance_in_seconds} seconds ago&quot; : 'a minute ago'
+      when 2..59 then time = &quot;#{distance_in_minutes} minutes ago&quot;
+      when 60..90 then time = &quot;an hour ago&quot;
+      when 90..1440 then time = &quot;#{(distance_in_minutes.to_f / 60.0).round} hours ago&quot;
+      when 1440..2160 then time = 'a day ago' # 1-1.5 days
+      when 2160..2880 then time = &quot;#{(distance_in_minutes.to_f / 1440.0).round} days ago&quot; # 1.5-2 days
+      else time = from_time.strftime(&quot;%d %B %Y&quot;)
     end
     return time_stamp(from_time) if (detail &amp;&amp; distance_in_minutes &gt; 2880)
-    return time
+    return time.to_s
   end
+
 end
 
 not_found do
@@ -46,11 +47,6 @@ get '/' do
   haml :index
 end
 
-get '/:query' do
-  @tweets = Twitter.get('http://search.twitter.com/search.json?q='+query)['results']
-  haml :index
-end
-
 # stylesheets
 
 get '/main.css' do
@@ -58,6 +54,11 @@ get '/main.css' do
   sass :main
 end
 
+get '/:query' do
+  @tweets = Twitter.get('http://search.twitter.com/search.json?q='+query)['results']
+  haml :index
+end
+
 # templates
 
 use_in_file_templates!
@@ -82,7 +83,7 @@ __END__
 - @tweets.each do |entry|
   .item
     %span.meta
-      %span.date= time_ago_or_time_stamp(entry['created_at'])
+      -#%span.date= relative_time(entry['created_at'])
       %span.name
         %a{:href=&gt;&quot;http://twitter.com/#{entry['from_user']}&quot;}= entry['from_user']
       %span.separator said</diff>
      <filename>meh-httparty.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4a8b18f0864b0dfb169a55c712140ec37c240619</id>
    </parent>
  </parents>
  <author>
    <name>seaofclouds</name>
    <email>todd@seaofclouds.com</email>
  </author>
  <url>http://github.com/seaofclouds/twitter-meh-experiment/commit/a42596809df168cf14b85483cc2892bc12a507d6</url>
  <id>a42596809df168cf14b85483cc2892bc12a507d6</id>
  <committed-date>2009-04-07T22:13:07-07:00</committed-date>
  <authored-date>2009-04-07T22:13:07-07:00</authored-date>
  <message>remove relative date ruby parser for now</message>
  <tree>4b098ee23942fd23bd0b614e99dd71235ee4e77a</tree>
  <committer>
    <name>seaofclouds</name>
    <email>todd@seaofclouds.com</email>
  </committer>
</commit>
