Skip to content

Instantly share code, notes, and snippets.

@rikukissa
Created September 28, 2013 16:52
Show Gist options
  • Save rikukissa/6744023 to your computer and use it in GitHub Desktop.
Save rikukissa/6744023 to your computer and use it in GitHub Desktop.
domo-weather
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