<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -16,7 +16,7 @@ require 'yaml'
 
 Twitter::Client.configure do |conf|
   conf.application_name     = 'PollenLondonBot'
-  conf.application_version  = '0.4'
+  conf.application_version  = '0.5'
   conf.application_url      = 'https://github.com/snowblink/pollen-london/tree'
   conf.source               = 'pollenlondon'
 end
@@ -32,19 +32,40 @@ doc = Hpricot(open(&quot;http://news.bbc.co.uk/weather/forecast/8/UV.xhtml&quot;))
 elements = doc.search(&quot;li&quot;)
 to_twitter = []
 
-elements.each do |element|
-  if element.get_attribute(&quot;class&quot;) == 'pollenval'
-    to_twitter &lt;&lt; element.at(&quot;img&quot;).get_attribute(&quot;alt&quot;) + ' (' + Time.now.gmtime.strftime(&quot;%a %d/%m&quot;) + ')'
-  end
+# 20091103 - Adding type of pollen based on time of year
+# Tree pollen forecasts from the 20th April to 19th May.
+# Grass pollen forecasts from the 20th May to 4th August.
+# Weed pollen forecasts from the 5th to 25th August.
+# Fungal Spore forecasts from the 25th August to 30th November. 
+
+pollen_type = if ((Date.civil(Date.today.year, 4, 20))..(Date.civil(Date.today.year, 5, 19))).include?(Date.today)
+  &quot;Tree Pollen&quot;
+elsif ((Date.civil(Date.today.year, 5, 20))..(Date.civil(Date.today.year, 8, 4))).include?(Date.today)
+  &quot;Grass Pollen&quot;
+elsif ((Date.civil(Date.today.year, 8, 5))..(Date.civil(Date.today.year, 8, 25))).include?(Date.today)
+  &quot;Weed Pollen&quot;
+elsif ((Date.civil(Date.today.year, 8, 25))..(Date.civil(Date.today.year, 11, 30))).include?(Date.today)
+  &quot;Fungal Spore&quot;
 end
 
-to_twitter.each do |update|
-  begin
-    twitter.status(:post, update)
-    # puts update
-  rescue Exception =&gt; e
-    puts &quot;FAILED!&quot;
-    puts e
-    exit 1
+if pollen_type.nil?
+  # Outside of pollen season
+else
+  
+  elements.each do |element|
+    if element.get_attribute(&quot;class&quot;) == 'pollenval'
+      to_twitter &lt;&lt; element.at(&quot;img&quot;).get_attribute(&quot;alt&quot;) + &quot; #{pollen_type} (&quot; + Time.now.gmtime.strftime(&quot;%a %d/%m&quot;) + ')'
+    end
   end
-end
\ No newline at end of file
+
+  to_twitter.each do |update|
+    begin
+      twitter.status(:post, update)
+      # puts update
+    rescue Exception =&gt; e
+      puts &quot;FAILED!&quot;
+      puts e
+      exit 1
+    end
+  end
+end</diff>
      <filename>pollen.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a3dbb0df37d06ab6972479b93380a025568daddb</id>
    </parent>
  </parents>
  <author>
    <name>Jonathan Lim</name>
    <email>snowblink@gmail.com</email>
  </author>
  <url>http://github.com/snowblink/pollen-london/commit/3d6a9bf8be61e22ba5b55c5f63d881fbeff07ae0</url>
  <id>3d6a9bf8be61e22ba5b55c5f63d881fbeff07ae0</id>
  <committed-date>2009-11-03T05:20:57-08:00</committed-date>
  <authored-date>2009-11-03T05:20:57-08:00</authored-date>
  <message>Adding type of pollen</message>
  <tree>a191284955f1b1ab591251644f57833af1d4b3b1</tree>
  <committer>
    <name>Jonathan Lim</name>
    <email>snowblink@gmail.com</email>
  </committer>
</commit>
