filesize in imgur

This commit is contained in:
reality 2015-07-19 21:34:09 +00:00
parent cf509cb3c5
commit bfa4de5a1a
3 changed files with 5 additions and 3 deletions

View File

@ -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

View File

@ -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;

View File

@ -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 {