rikukissa
9/28/2013 - 4:52 PM

domo-weather

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();