From bfa4de5a1a0f98bb8744f891c79b8007b77f7ef5 Mon Sep 17 00:00:00 2001 From: reality Date: Sun, 19 Jul 2015 21:34:09 +0000 Subject: [PATCH] filesize in imgur --- install | 2 +- modules/imgur/imgur.js | 5 ++++- modules/users/users.js | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/install b/install index 4e7573d..c3c3162 100755 --- a/install +++ b/install @@ -14,7 +14,7 @@ then exit 1 fi -npm install googlemaps feedparser node-units tvdb method-override 500px process async wordnik node-uuid underscore request sandbox express moment-timezone moment jade databank databank-redis ent passport passport-local password-hash connect-flash +npm install googlemaps humanize feedparser node-units tvdb method-override 500px process async wordnik node-uuid underscore request sandbox express moment-timezone moment jade databank databank-redis ent passport passport-local password-hash connect-flash cd public/ wget https://github.com/twbs/bootstrap/releases/download/v3.3.2/bootstrap-3.3.2-dist.zip diff --git a/modules/imgur/imgur.js b/modules/imgur/imgur.js index 283e9a8..0378b87 100644 --- a/modules/imgur/imgur.js +++ b/modules/imgur/imgur.js @@ -6,7 +6,8 @@ var _ = require('underscore')._, request = require('request'), async = require('async'), - crypto = require('crypto'); + crypto = require('crypto'), + humanise = require('humanize'); var imgur = function(dbot) { this.ApiRoot = 'https://api.imgur.com/3/'; @@ -42,6 +43,8 @@ var imgur = function(dbot) { } info += imgData.views + ' views ('; info += imgData.width + 'x' + imgData.height + ')'; + + info += ' ('+humanise.filesize(imgData.size)+')'; } return info; diff --git a/modules/users/users.js b/modules/users/users.js index 91d8ff4..5b72d3a 100644 --- a/modules/users/users.js +++ b/modules/users/users.js @@ -140,7 +140,6 @@ var users = function(dbot) { }.bind(this); var checkUserTime = function(user, done) { if(!_.has(user, 'lastUsed') || (_.has(user, 'lastUsed') && moment(user.lastUsed).diff(moment(user.lastUsed).add(1, 'day'), 'days') > 0)) { - dbot.api.log.log('tripsit', 'tripbot', '[USERDEBUG] Updating last used date for ' + user.primaryNick); user.lastUsed = moment().unix(); this.db.save('users', user.id, user, done); } else {