Created
September 28, 2013 16:52
-
-
Save rikukissa/6744023 to your computer and use it in GitHub Desktop.
domo-weather
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
domo.route('!weather :city', function(res) { | |
var response = request.get('http://api.openweathermap.org/data/2.5/weather?q=' + res.params.city + ',FI&units=metric&lang=fi', function (error, response, body) { | |
if (error || response.statusCode !== 200) return; | |
var data = JSON.parse(body); | |
var saa = data.main.temp; | |
this.say(res.channel, 'Sää ' + res.params.city + ': ' + saa); | |
}); | |
}); | |
domo.connect(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment