updated weather to include temp

This commit is contained in:
Martin Donnelly 2016-02-15 10:01:07 +00:00
parent 23fe4912ec
commit f7c331cc78

View File

@ -250,10 +250,21 @@ module.exports = {
forecast.get(55.8582846, -4.2593033, {units: 'uk2'}, function (err, res, data) {
if (err) throw err;
var tempMin = parseInt(data.daily.data[0].temperatureMin);
var tempMax = parseInt(data.daily.data[0].temperatureMax);
j.currently = data.currently.summary;
j.today = data.daily.data[0].summary;
j.later = data.daily.summary;
j.alerts = data.alerts || {};
if (tempMax == tempMin) {
data.currently.summary += '<br/>Around ' + tempMin.toString() + ' degrees.';
}
else
{
data.currently.summary += '<br/>Around ' + tempMin.toString() + ' to ' + tempMax.toString() + ' degrees.';
}
todayCache.data.weather = j;
});