<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>examples/forecast.rb</filename>
    </added>
    <added>
      <filename>lib/google_weather/data.rb</filename>
    </added>
    <added>
      <filename>test/fixtures/46544.xml</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,10 @@
 = google-weather
 
-Description goes here.
+Stupid simple fetching of the weather using google's api
+
+= example
+
+See the examples directory. Trust me it is easy though.
 
 == Copyright
 </diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@ begin
   require 'jeweler'
   Jeweler::Tasks.new do |gem|
     gem.name = &quot;google-weather&quot;
-    gem.summary = %Q{TODO}
+    gem.summary = &quot;stupid simple fetching of the weather using google's api&quot;
     gem.email = &quot;nunemaker@gmail.com&quot;
     gem.homepage = &quot;http://github.com/jnunemaker/google-weather&quot;
     gem.authors = [&quot;John Nunemaker&quot;]</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -0,0 +1,31 @@
+require 'rubygems'
+gem 'httparty'
+require 'httparty'
+require File.dirname(__FILE__) + '/google_weather/data'
+
+class GoogleWeather  
+  include HTTParty
+  base_uri &quot;www.google.com&quot;
+  
+  attr_reader :zip
+  
+  def initialize(zip)
+    @zip = zip
+  end
+  
+  def weather
+    @weather ||= self.class.get(&quot;/ig/api&quot;, :query =&gt; {:weather =&gt; @zip}, :format =&gt; :xml)['xml_api_reply']['weather']
+  end
+  
+  def forecast_information
+    @forecast_information ||= ForecastInformation.new(weather['forecast_information'])
+  end
+  
+  def current_conditions
+    @current_conditions ||= CurrentConditions.new(weather['current_conditions'])
+  end
+  
+  def forecast_conditions
+    @forecast_conditions ||= weather['forecast_conditions'].map { |cond| ForecastCondition.new(cond) }
+  end
+end</diff>
      <filename>lib/google_weather.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,129 @@
 require 'test_helper'
 
 class GoogleWeatherTest &lt; Test::Unit::TestCase
-  should &quot;probably rename this file and start testing for real&quot; do
-    flunk &quot;hey buddy, you should probably rename this file and start testing for real&quot;
+  context &quot;Initialization&quot; do
+    should &quot;require a zip code&quot; do
+      lambda { GoogleWeather.new }.should raise_error
+      
+      GoogleWeather.new(46544).zip.should == 46544
+    end
+  end
+  
+  context &quot;Data&quot; do
+    setup do
+      @data = GoogleWeather::Data.new({'foo' =&gt; {'data' =&gt; 'bar'}})
+    end
+
+    should &quot;use method missing to get value for existing keys&quot; do
+      @data.foo.should == 'bar'
+    end
+    
+    should &quot;return nil for missing keys&quot; do
+      @data.foobar.should be(nil)
+    end
+  end
+  
+  
+  context &quot;Fetching&quot; do
+    setup do
+      FakeWeb.register_uri(:get, &quot;http://www.google.com/ig/api?weather=46544&quot;, :string =&gt; File.read(&quot;fixtures/46544.xml&quot;))
+      @weather = GoogleWeather.new(46544)
+    end
+    
+    should &quot;have forecast information&quot; do
+      information = @weather.forecast_information
+      information.city.should == 'Mishawaka, IN'
+      information.postal_code.should == '46544'
+      information.unit_system.should == 'US'
+      information.forecast_date.should == '2009-03-24'
+      information.current_date_time.should == '2009-03-25 04:16:27 +0000'
+    end
+    
+    should &quot;have current conditions&quot; do
+      conditions = @weather.current_conditions
+      conditions.humidity.should == 'Humidity: 48%'
+      conditions.icon.should == '/images/weather/cloudy.gif'
+      conditions.temp_c.should == '17'
+      conditions.temp_f.should == '62'
+      conditions.condition.should == 'Overcast'
+      conditions.wind_condition.should == 'Wind: SE at 11 mph'
+    end
+    
+    should &quot;have forecast conditions&quot; do
+      conditions = @weather.forecast_conditions
+      conditions[0].low.should == '45'
+      conditions[0].high.should == '67'
+      conditions[0].icon.should == '/images/weather/mostly_sunny.gif'
+      conditions[0].condition.should == 'Partly Sunny'
+      conditions[0].day_of_week.should == 'Tue'
+      conditions[1].low.should == '34'
+      conditions[1].high.should == '52'
+      conditions[1].icon.should == '/images/weather/mostly_sunny.gif'
+      conditions[1].condition.should == 'Mostly Sunny'
+      conditions[1].day_of_week.should == 'Wed'
+    end
   end
 end
+
+__END__
+
+Example hash that comes back from Google
+
+{
+  &quot;xml_api_reply&quot;=&gt; {
+    &quot;version&quot;=&gt;&quot;1&quot;, 
+    &quot;weather&quot;=&gt; {
+      &quot;mobile_row&quot;=&gt;&quot;0&quot;, 
+      &quot;mobile_zipped&quot;=&gt;&quot;1&quot;, 
+      &quot;module_id&quot;=&gt;&quot;0&quot;, 
+      &quot;forecast_information&quot;=&gt;{
+        &quot;city&quot;=&gt;{&quot;data&quot;=&gt;&quot;Mishawaka, IN&quot;}, 
+        &quot;postal_code&quot;=&gt;{&quot;data&quot;=&gt;&quot;46544&quot;}, 
+        &quot;longitude_e6&quot;=&gt;{&quot;data&quot;=&gt;&quot;&quot;}, 
+        &quot;current_date_time&quot;=&gt;{&quot;data&quot;=&gt;&quot;2009-03-25 04:16:27 +0000&quot;}, 
+        &quot;latitude_e6&quot;=&gt;{&quot;data&quot;=&gt;&quot;&quot;}, 
+        &quot;forecast_date&quot;=&gt;{&quot;data&quot;=&gt;&quot;2009-03-24&quot;}, 
+        &quot;unit_system&quot;=&gt;{&quot;data&quot;=&gt;&quot;US&quot;}
+      }, 
+      &quot;current_conditions&quot;=&gt; {
+        &quot;humidity&quot;=&gt;{&quot;data&quot;=&gt;&quot;Humidity: 48%&quot;},
+        &quot;icon&quot;=&gt;{&quot;data&quot;=&gt;&quot;/images/weather/cloudy.gif&quot;}, 
+        &quot;condition&quot;=&gt;{&quot;data&quot;=&gt;&quot;Overcast&quot;}, 
+        &quot;temp_c&quot;=&gt;{&quot;data&quot;=&gt;&quot;17&quot;}, 
+        &quot;wind_condition&quot;=&gt;{&quot;data&quot;=&gt;&quot;Wind: SE at 11 mph&quot;}, 
+        &quot;temp_f&quot;=&gt;{&quot;data&quot;=&gt;&quot;62&quot;}
+      }, 
+      &quot;tab_id&quot;=&gt;&quot;0&quot;, 
+      &quot;forecast_conditions&quot;=&gt;[
+        {
+          &quot;high&quot;=&gt;{&quot;data&quot;=&gt;&quot;67&quot;}, 
+          &quot;day_of_week&quot;=&gt;{&quot;data&quot;=&gt;&quot;Tue&quot;},
+          &quot;icon&quot;=&gt;{&quot;data&quot;=&gt;&quot;/images/weather/mostly_sunny.gif&quot;}, 
+          &quot;condition&quot;=&gt;{&quot;data&quot;=&gt;&quot;Partly Sunny&quot;}, 
+          &quot;low&quot;=&gt;{&quot;data&quot;=&gt;&quot;45&quot;}
+        }, 
+        {
+          &quot;high&quot;=&gt;{&quot;data&quot;=&gt;&quot;52&quot;}, 
+          &quot;day_of_week&quot;=&gt;{&quot;data&quot;=&gt;&quot;Wed&quot;}, 
+          &quot;icon&quot;=&gt;{&quot;data&quot;=&gt;&quot;/images/weather/mostly_sunny.gif&quot;}, 
+          &quot;condition&quot;=&gt;{&quot;data&quot;=&gt;&quot;Mostly Sunny&quot;}, 
+          &quot;low&quot;=&gt;{&quot;data&quot;=&gt;&quot;34&quot;}
+        },
+        {
+          &quot;high&quot;=&gt;{&quot;data&quot;=&gt;&quot;54&quot;}, 
+          &quot;day_of_week&quot;=&gt;{&quot;data&quot;=&gt;&quot;Thu&quot;}, 
+          &quot;icon&quot;=&gt;{&quot;data&quot;=&gt;&quot;/images/weather/mostly_sunny.gif&quot;}, 
+          &quot;condition&quot;=&gt;{&quot;data&quot;=&gt;&quot;Mostly Sunny&quot;}, 
+          &quot;low&quot;=&gt;{&quot;data&quot;=&gt;&quot;36&quot;}
+        }, 
+        {
+          &quot;high&quot;=&gt;{&quot;data&quot;=&gt;&quot;56&quot;}, 
+          &quot;day_of_week&quot;=&gt;{&quot;data&quot;=&gt;&quot;Fri&quot;}, 
+          &quot;icon&quot;=&gt;{&quot;data&quot;=&gt;&quot;/images/weather/mostly_sunny.gif&quot;}, 
+          &quot;condition&quot;=&gt;{&quot;data&quot;=&gt;&quot;Mostly Sunny&quot;}, 
+          &quot;low&quot;=&gt;{&quot;data&quot;=&gt;&quot;38&quot;}
+        }
+      ]
+    }
+  }
+}
\ No newline at end of file</diff>
      <filename>test/google_weather_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,10 @@
 require 'rubygems'
 require 'test/unit'
 require 'shoulda'
+require 'matchy'
+require 'fakeweb'
+
+FakeWeb.allow_net_connect = false
 
 $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
 $LOAD_PATH.unshift(File.dirname(__FILE__))</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>57d4fcdb51a72f40d55bd77b7970970a3828c548</id>
    </parent>
  </parents>
  <author>
    <name>John Nunemaker</name>
    <email>nunemaker@gmail.com</email>
  </author>
  <url>http://github.com/jnunemaker/google-weather/commit/6111d66783bf340c23288f8cfbc6da3321877c2f</url>
  <id>6111d66783bf340c23288f8cfbc6da3321877c2f</id>
  <committed-date>2009-03-24T22:48:06-07:00</committed-date>
  <authored-date>2009-03-24T22:48:06-07:00</authored-date>
  <message>First commit of the goods.</message>
  <tree>d5492831dc833142a9aaf8dd6ccf2bdf0133b2fc</tree>
  <committer>
    <name>John Nunemaker</name>
    <email>nunemaker@gmail.com</email>
  </committer>
</commit>
