diff --git a/modules/imgur/config.json b/modules/imgur/config.json index cc20a5d..853aa84 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 a546314..17cda65 100644 --- a/modules/imgur/imgur.js +++ b/modules/imgur/imgur.js @@ -52,12 +52,15 @@ var imgur = function(dbot) { if(!error && response.statusCode == 200 && body.length != 492) { this.db.totalImages += 1; var hash = crypto.createHash('md5').update(body).digest("hex"); - if((hash == "e49e686582ce3f60cb51d00c10924861") && _.has(dbot.modules, 'quotes')){ - var qdb = dbot.db.quoteArrs["facebookman"]; - if (_.include(qdb, testUrl)){ - // do something - } else { - qdb.push(testUrl); + 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);