forked from GitHub/dbot
Adding config option to auto-add hashes to qdb
This should be useful for keeping track of certain massively duplicated images.
This commit is contained in:
parent
fb24c4d8ee
commit
be1ea0acde
@ -4,5 +4,9 @@
|
||||
"imagelength": 5,
|
||||
"nsfwwarn": true,
|
||||
"apikey": "86fd3a8da348b65",
|
||||
"highscore": "ricount"
|
||||
"highscore": "ricount",
|
||||
"autoadd": {
|
||||
"e49e686582ce3f60cb51d00c10924861": "facebookman",
|
||||
"b11b634c74562bcd4e5d17b0d90987be": "raffleguy"
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user