diff --git a/modules/admin/strings.json b/modules/admin/strings.json index 3172912..b2d12df 100644 --- a/modules/admin/strings.json +++ b/modules/admin/strings.json @@ -106,7 +106,7 @@ "en": "{module} status: Failed to load: {reason}" }, "status_unloaded": { - "en": "Either thata module wasn't on the roster or shit is totally fucked." + "en": "Either that module wasn't on the roster or shit is totally fucked." }, "load_failed": { "en": "Failed to load {module}. See 'status {module}'." diff --git a/modules/imgur/config.json b/modules/imgur/config.json index 1e7a352..73f36c9 100644 --- a/modules/imgur/config.json +++ b/modules/imgur/config.json @@ -4,5 +4,9 @@ "imagelength": 5, "nsfwwarn": true, "apikey": "86fd3a8da348b65", - "highscore": "ricount" + "highscore": "ricount", + "autoadd": { + "e49e686582ce3f60cb51d00c10924861": "facebookman", + "b11b634c74562bcd4e5d17b0d90987be": "raffleguy" + } } diff --git a/modules/imgur/imgur.js b/modules/imgur/imgur.js index f9ec547..005d164 100644 --- a/modules/imgur/imgur.js +++ b/modules/imgur/imgur.js @@ -51,6 +51,17 @@ var imgur = function(dbot) { if(!error && response.statusCode == 200 && body.length != 492) { dbot.db.imgur.totalImages += 1; var hash = crypto.createHash('md5').update(body).digest("hex"); + if(_.has(dbot.modules, 'quotes')){ + // autoadd: {"abcdef": "facebookman"} + if(_.has(dbot.config.imgur.autoadd,hash)){ + var category = dbot.config.imgur.autoadd[hash]; + if (_.contains(category, testUrl)){ + // there's probably less than 62^5 chance of this happening + } else { + dbot.db.quoteArrs[category].push(testUrl); + } + } + } callback(testUrl, testSlug,hash); } else { this.api.getRandomImage(callback); diff --git a/public/imgurr.js b/public/imgurr.js index 5c03f60..f8e5d41 100644 --- a/public/imgurr.js +++ b/public/imgurr.js @@ -49,6 +49,7 @@ function getNewImage() { $(getNewImage()); +var t; $(document).on('keydown', function(e){ switch(e.which){ case 82: // r @@ -72,5 +73,21 @@ $(document).on('keydown', function(e){ case 83: // s $('body').toggleClass('crop'); giveMessage("Toggled scrollbars.") + break; + case 190: // . + if(!t){ + giveMessage("Automation on."); + $('#loading').css("font-style", "italic"); + $('#loading').css("color","#BF2527"); + t = setInterval(function(){ + getNewImage(); + },5000); + } else { + giveMessage("Automation off."); + $('#loading').css("font-style","normal"); + $('#loading').css("color","#85BF25"); + clearTimeout(t); + t = undefined; + } }; });