From e7540a35078134ae7aa0c7d43f1d7ad05a6000a9 Mon Sep 17 00:00:00 2001 From: reality Date: Tue, 16 Apr 2013 18:59:29 +0000 Subject: [PATCH] stats on web --- modules/imgur/pages.js | 10 +++++++++- views/imgur/imgurstats.jade | 9 +++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 views/imgur/imgurstats.jade diff --git a/modules/imgur/pages.js b/modules/imgur/pages.js index e257b40..42b7d0d 100644 --- a/modules/imgur/pages.js +++ b/modules/imgur/pages.js @@ -3,7 +3,15 @@ var _ = require('underscore')._; var pages = function(dbot) { return { '/imgur/random': function(req, res) { - res.render('imgurr', { + res.render('imgurr', { }); + }, + + '/imgur/stats': function(req, res) { + res.render('imgurstats', { + 'name': dbot.config.name, + 'totalHttpRequests': this.db.totalHttpRequests, + 'totalApiRequests': this.db.totalApiRequests, + 'totalImages': this.db.totalImages }); } }; diff --git a/views/imgur/imgurstats.jade b/views/imgur/imgurstats.jade new file mode 100644 index 0000000..0ede32d --- /dev/null +++ b/views/imgur/imgurstats.jade @@ -0,0 +1,9 @@ +extends ../layout + +block content + div#http + Total Imgur HTTP requests made: #{totalHttpRequests} + div#api + Total Imgur API requests made: #{totalApiRequests} + div#images + Total Images generated: #{totalImages}