minor updates
This commit is contained in:
parent
8f1de5e809
commit
9326877e98
@ -37,9 +37,14 @@ module.exports = {
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}, function(error, response, body) {
|
||||
if(response.statusCode !== 200) {
|
||||
logger.error(response.statusCode);
|
||||
logger.error(body);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
//module.exports.getSwedishWord();
|
||||
//module.exports.getSwedishWord();
|
||||
|
19
lib/today.js
19
lib/today.js
@ -154,6 +154,11 @@ module.exports = {
|
||||
});
|
||||
todayCache.data.history = todayCache.data.history.concat(output);
|
||||
console.log(todayCache.data.history);
|
||||
}, function(error, response, body) {
|
||||
if(response.statusCode !== 200) {
|
||||
logger.error(response.statusCode);
|
||||
logger.error(body);
|
||||
}
|
||||
});
|
||||
},
|
||||
getHistory: function () {
|
||||
@ -188,7 +193,12 @@ module.exports = {
|
||||
console.log(todayCache.data.history);
|
||||
module.exports.getTechHistory();
|
||||
|
||||
});
|
||||
}, function(error, response, body) {
|
||||
if(response.statusCode !== 200) {
|
||||
logger.error(response.statusCode);
|
||||
logger.error(body);
|
||||
}
|
||||
});
|
||||
},
|
||||
getTrainUpdates: function (id) {
|
||||
console.log('Getting train events...');
|
||||
@ -244,7 +254,12 @@ module.exports = {
|
||||
}
|
||||
todayCache.data.trains.data = _.uniq(todayCache.data.trains.data);
|
||||
|
||||
});
|
||||
}, function(error, response, body) {
|
||||
if(response.statusCode !== 200) {
|
||||
logger.error(response.statusCode);
|
||||
logger.error(body);
|
||||
}
|
||||
});
|
||||
|
||||
todayCache.data.trains.last = now;
|
||||
|
||||
|
@ -174,6 +174,9 @@ function Query(callback, r, host, path) {
|
||||
response.on('end', function () {
|
||||
callback(JSON.parse(data), r);
|
||||
});
|
||||
response.on('error', function(e) {
|
||||
console.error(e);
|
||||
});
|
||||
}).end();
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
|
Loading…
Reference in New Issue
Block a user