diff --git a/modules/imgur/imgur.js b/modules/imgur/imgur.js index 507e6f2..b412d4c 100644 --- a/modules/imgur/imgur.js +++ b/modules/imgur/imgur.js @@ -4,7 +4,8 @@ */ var _ = require('underscore')._, - request = require('request'); + request = require('request'), + crypto = require('crypto'); var imgur = function(dbot) { this.db = dbot.db.imgur; @@ -50,7 +51,8 @@ var imgur = function(dbot) { // 492 is body.length of a removed image if(!error && response.statusCode == 200 && body.length != 492) { this.db.totalImages += 1; - callback(testUrl, testSlug); + var hash = crypto.createHash('md5').update(body).digest("hex"); + callback(testUrl, testSlug,hash); } else { this.api.getRandomImage(callback); } diff --git a/public/imgurr.css b/public/imgurr.css index f2bbb11..37d6fc7 100644 --- a/public/imgurr.css +++ b/public/imgurr.css @@ -106,3 +106,15 @@ html,body { overflow:auto; padding:0; } +#count2 { + bottom:25px; + position:absolute; + border-radius:5px; + display:none; + margin;5px; + padding:5px; + right:25px; + background-color:#3b5998; + color:white; + font-family:'Freight Sans Bold','Lucida Grande',verdana,arial,sans-serif; +} diff --git a/views/imgur/imgurr.jade b/views/imgur/imgurr.jade index b3e4436..35d05ba 100644 --- a/views/imgur/imgurr.jade +++ b/views/imgur/imgurr.jade @@ -3,73 +3,16 @@ html(lang='en') head meta(charset='utf-8') script(type="text/javascript", src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js") + script(type="text/javascript", src="/imgurr.js") link(rel="stylesheet", href="/imgurr.css") title random imgur - script - var count = 0; - function giveMessage(msg) { - $('