3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-24 04:49:25 +01:00

complete module

This commit is contained in:
Douglas Gardner 2013-02-07 16:47:05 +00:00
parent be80b185ed
commit f4a118db89
2 changed files with 6 additions and 6 deletions

View File

@ -11,7 +11,7 @@ var rain = function(dbot) {
var apikey = dbot.config.rain.apikey; var apikey = dbot.config.rain.apikey;
var place = event.input[1]; var place = event.input[1];
if (!place) { var place = "Aberystwyth"; } if (!place) { var place = "Aberystwyth"; }
var url = "http://api.wunderground.com/api/" + apikey + "/conditions/q/CA/" + place + ".json"; var url = "http://api.wunderground.com/api/" + apikey + "/conditions/q/" + place + ".json";
request(url, function(error, response, body) { request(url, function(error, response, body) {
if(response.statusCode == "200") { if(response.statusCode == "200") {
var data = JSON.parse(body); var data = JSON.parse(body);
@ -27,7 +27,7 @@ var rain = function(dbot) {
} else { } else {
var score = "e"; var score = "e";
} }
event.reply(dbot.t("rain-"+score)); event.reply(dbot.t("rain-"+score,{"place": place}));
}); });
} }
}; };

View File

@ -1,12 +1,12 @@
{ {
"rain-0": { "rain-0": {
"english" : "It's not raining." "english" : "It's not raining in {place}."
}, },
"rain-1": { "rain-1": {
"english" : "It's raining." "english" : "It's raining in {place}."
}, },
"rain-2": { "rain-2": {
"english" : "It's raining rather a lot." "english" : "It's raining rather a lot in {place}."
}, },
"rain-3": { "rain-3": {
"english" : "It's raining shitloads." "english" : "It's raining shitloads."
@ -15,7 +15,7 @@
"english" : "It's raining fucktons." "english" : "It's raining fucktons."
}, },
"rain-5": { "rain-5": {
"english" : "It's raining whales (in Wales)!" "english" : "It's raining whales (in {place})!"
}, },
"rain-6": { "rain-6": {
"english" : "IT'S SO FUCKING WET OUT HERE MAN" "english" : "IT'S SO FUCKING WET OUT HERE MAN"