<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -5,6 +5,12 @@ A Ruby Gem that wraps the Weather Channel, inc. XML data feed
 written by Jared Pace, Codeword: Studios (http://codewordstudios.com),
 based on the [rweather gem](http://github.com/ckozus/rweather) by [Carlos Kozuszko](http://www.ckozus.com.ar/blog/).
 
+Dependencies
+------------
+
+1.  XmlSimple
+		`gem install xml-simple`
+
 
 Installation
 ------------
@@ -73,4 +79,12 @@ Look at the forecast:
 		
 		night_wind_speed = friday.night.wind.speed
 		
+The Weather Channel requires that you 4 promotional links for them if you use their service. Here's how to access those links:
+		# The array of pr links
+		weather.links
+		
+		# Getting the first links text and url
+		weather.links.first.text
+		weather.links.first.url
+		
 *TODO:* Document all attributes
\ No newline at end of file</diff>
      <filename>README.markdown</filename>
    </modified>
    <modified>
      <diff>@@ -39,8 +39,8 @@ class WeatherMan
     self.class.check_authentication
   end
   
-  def fetch(options = {})
-    options = default_forecast_options.merge(options)
+  def fetch(opts = {})
+    options = default_forecast_options.merge(opts)
     api_url = weather_url(options) 
     
     WeatherManResponse.new(self.class.fetch_response(api_url), api_url)
@@ -84,7 +84,7 @@ class WeatherMan
     # Encode a hash of options to be used as request parameters
     def encode_options(options)
       options.each do |key,value|
-        options[key] = URI.encode(value.to_s)
+        options[key] = URI.encode(value.to_s) unless value.is_a?(TrueClass) || value.is_a?(FalseClass)
       end
     end
     </diff>
      <filename>lib/weather_man.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,59 +1,78 @@
 require 'ostruct'
 
 class WeatherManResponse
-  attr_reader :current_conditions, :forecast, :api_url
+  attr_reader :current_conditions, :forecast, :api_url, :unit_temperature, :unit_distance, :unit_speed, :unit_pressure, :links
   
   def initialize(simple_xml, url = nil)
-    @current_conditions = build_current_conditions(simple_xml['cc'][0])
-    @forecast = build_forecast(simple_xml['dayf'][0]['day'])
+    @current_conditions = simple_xml['cc'] ? build_current_conditions(simple_xml['cc'][0]) : nil
+    @forecast = simple_xml['dayf'] ? build_forecast(simple_xml['dayf'][0]['day']) : nil
+    
+    # Promotional links required by Weather Channel, Inc.
+    @links = simple_xml['lnks'] ? build_links(simple_xml['lnks'][0]['link']) : nil
+    
+    # Capture the units
+    @unit_temperature = simple_xml['head'][0]['ut'][0]
+    @unit_distance    = simple_xml['head'][0]['ud'][0]
+    @unit_speed       = simple_xml['head'][0]['us'][0]
+    @unit_pressure    = simple_xml['head'][0]['up'][0]
     
     # The api url that was called to generate this response
     @api_url = url
   end
   
-  def build_current_conditions(response = {})
-    return nil if response.nil? || response.empty?
+  protected
+    def build_current_conditions(response = {})
+      return nil if response.nil? || response.empty?
     
-    cc = WeatherManCurrentConditions.new
+      cc = WeatherManCurrentConditions.new
     
-    # Parse out Current Conditions
-    cc.temperature          = response['tmp'][0]
-    cc.feels_like           = response['flik'][0]
-    cc.description          = response['t'][0]
-    cc.icon_code            = response['icon'][0]
-    cc.humidity             = response['hmid'][0]
-    cc.visibility           = response['vis'][0]
-    cc.dew_point            = response['dewp'][0]
-    cc.barometric_pressure  = WeatherManBarometer.new({
-                                :reading      =&gt; response['bar'][0]['r'][0],
-                                :description  =&gt; response['bar'][0]['d'][0]
-                              })
-    cc.wind                 = WeatherManWind.new({
-                                :speed        =&gt; response['wind'][0]['s'][0],
-                                :gust         =&gt; response['wind'][0]['gust'][0],
-                                :degrees      =&gt; response['wind'][0]['d'][0],
-                                :direction    =&gt; response['wind'][0]['t'][0]
-                              })
-    cc.uv                   = WeatherManUV.new({
-                                :index        =&gt; response['uv'][0]['i'][0],
-                                :description  =&gt; response['uv'][0]['t'][0]
-                              })
-    cc.moon                 = WeatherManMoon.new({
-                                :icon_code    =&gt; response['moon'][0]['icon'][0],
-                                :description  =&gt; response['moon'][0]['t'][0]
-                              })
-    cc    
-  end
+      # Parse out Current Conditions
+      cc.temperature          = response['tmp'][0]
+      cc.feels_like           = response['flik'][0]
+      cc.description          = response['t'][0]
+      cc.icon_code            = response['icon'][0]
+      cc.humidity             = response['hmid'][0]
+      cc.visibility           = response['vis'][0]
+      cc.dew_point            = response['dewp'][0]
+      cc.barometric_pressure  = WeatherManBarometer.new({
+                                  :reading      =&gt; response['bar'][0]['r'][0],
+                                  :description  =&gt; response['bar'][0]['d'][0]
+                                })
+      cc.wind                 = WeatherManWind.new({
+                                  :speed        =&gt; response['wind'][0]['s'][0],
+                                  :gust         =&gt; response['wind'][0]['gust'][0],
+                                  :degrees      =&gt; response['wind'][0]['d'][0],
+                                  :direction    =&gt; response['wind'][0]['t'][0]
+                                })
+      cc.uv                   = WeatherManUV.new({
+                                  :index        =&gt; response['uv'][0]['i'][0],
+                                  :description  =&gt; response['uv'][0]['t'][0]
+                                })
+      cc.moon                 = WeatherManMoon.new({
+                                  :icon_code    =&gt; response['moon'][0]['icon'][0],
+                                  :description  =&gt; response['moon'][0]['t'][0]
+                                })
+      cc    
+    end
   
-  def build_forecast(days = {})
-    return nil if days.nil? || days.empty?
+    def build_forecast(days = [])
+      return nil if days.nil? || days.empty?
     
-    f = WeatherManForecast.new
-    days.each do |day|
-      f &lt;&lt; WeatherManForecastDay.build(day)
+      f = WeatherManForecast.new
+      days.each do |day|
+        f &lt;&lt; WeatherManForecastDay.build(day)
+      end
+      f
+    end
+    
+    def build_links(links = [])
+      return nil if links.nil? || links.empty?
+      
+      links.map {|link| WeatherManPromotionalLink.new({
+        :text =&gt; link['t'][0],
+        :url  =&gt; link['l'][0]
+      })}
     end
-    f
-  end
 end
 
 class WeatherManCurrentConditions
@@ -175,4 +194,7 @@ class WeatherManMoon &lt; OpenStruct
 end
 
 class WeatherManWind &lt; OpenStruct
+end
+
+class WeatherManPromotionalLink &lt; OpenStruct
 end
\ No newline at end of file</diff>
      <filename>lib/weather_man_response.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1745a63a96f94ac29739e3a4c3d258fce358b84f</id>
    </parent>
  </parents>
  <author>
    <name>Jared Pace</name>
    <email>jared@codewordstudios.com</email>
  </author>
  <url>http://github.com/jdpace/weatherman/commit/dbf90f3ba9e9b622c81f8ad78ebb977a704493b6</url>
  <id>dbf90f3ba9e9b622c81f8ad78ebb977a704493b6</id>
  <committed-date>2008-09-29T18:23:31-07:00</committed-date>
  <authored-date>2008-09-29T18:23:31-07:00</authored-date>
  <message>Added tracking of promotional links as required by the TOS of Weather Channel, inc.</message>
  <tree>bf5264421a514c89c48513a7b3f3511c890eb3cf</tree>
  <committer>
    <name>Jared Pace</name>
    <email>jared@codewordstudios.com</email>
  </committer>
</commit>
