From c9161c10ae6cdd99b129cbbe3487b08da291ab5e Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Wed, 30 Jan 2013 12:43:17 +0000 Subject: [PATCH] it was raining cats and dogs; there were poodles all over the road --- modules/rain/rain.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/rain/rain.js b/modules/rain/rain.js index 5af0b5c..ca6a38c 100644 --- a/modules/rain/rain.js +++ b/modules/rain/rain.js @@ -14,14 +14,14 @@ var rain = function(dbot) { request(url, function(error, response, body) { if(response.statusCode == "200") { var data = JSON.parse(body); - var precip = data["precip_1hr_metric"]; + var precip = data["current_observation"]["precip_1hr_metric"]; var score = 2 * Math.pow(precip,0.5); score = Math.ceil(score); if (score > 10) { score = 11; } } else { var score = "e"; } - event.reply(dbot.t("rain-"+score+"[ " + score + " ]")); + event.reply(dbot.t("rain-"+score)); }); } };