Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed constant variable warning in swineflu

  • Loading branch information...
commit f0fccfe6b7d5ee330820857c3e2c3349b1dbcf8a 1 parent 8fe72a9
samlehman authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 fatbot.rb
View
8 fatbot.rb
@@ -122,7 +122,7 @@ def ops?(nick)
# http://flutracker.rhizalabs.com/flu/downloads.html
# data is released under Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.
on :channel, /^\!(swineflu|pigflu).*/i do
- url, shorturl, totals = "http://flutracker.rhizalabs.com/flu/gmap.html", "http://bit.ly/9wwcR", []
+ url, shorturl, totals, usdata = "http://flutracker.rhizalabs.com/flu/gmap.html", "http://bit.ly/9wwcR", [], 0
begin
page = WWW::Mechanize.new.get(url)
aggregates = (page/'script').map { |i| i.content }
@@ -135,12 +135,12 @@ def ops?(nick)
fludata = Crack::JSON.parse(fludata.read)
fludata.each do |x|
if x["country"] == "US"
- USdata = x
+ usdata = x
end
end
- cases = USdata["cases"]
- fatal = USdata["Fatal"]
+ cases = usdata["cases"]
+ fatal = usdata["Fatal"]
text = "U.S. Human Cases of H1N1 Flu Infection (As of #{timedate}): Cases: #{cases} - Deaths: #{fatal} -- http://flutracker.rhizalabs.com/"
Please sign in to comment.
Something went wrong with that request. Please try again.