2013-04-15 02:10:29 +01:00
|
|
|
var _ = require('underscore')._;
|
|
|
|
|
|
|
|
var pages = function(dbot) {
|
|
|
|
return {
|
|
|
|
'/imgur/random': function(req, res) {
|
2013-04-19 17:06:19 +00:00
|
|
|
var quoteCat = dbot.db.quoteArrs[dbot.config.imgur.highscore],
|
|
|
|
highScore = 0;
|
|
|
|
|
|
|
|
if(quoteCat) {
|
|
|
|
highScore = _.last(quoteCat);
|
|
|
|
}
|
|
|
|
|
|
|
|
res.render('imgurr', { "highscore" : highScore });
|
2013-04-16 18:59:29 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
'/imgur/stats': function(req, res) {
|
|
|
|
res.render('imgurstats', {
|
|
|
|
'name': dbot.config.name,
|
|
|
|
'totalHttpRequests': this.db.totalHttpRequests,
|
|
|
|
'totalApiRequests': this.db.totalApiRequests,
|
|
|
|
'totalImages': this.db.totalImages
|
2013-04-15 02:10:29 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.fetch = function(dbot) {
|
|
|
|
return pages(dbot);
|
|
|
|
};
|