mirror of
https://github.com/reality/dbot.git
synced 2024-12-02 17:09:29 +01:00
reset that shit
This commit is contained in:
parent
a9fdd82911
commit
509911aae0
@ -79,29 +79,26 @@ var imgur = function(dbot) {
|
|||||||
'.' + ext[_.random(0, ext.length - 1)];
|
'.' + ext[_.random(0, ext.length - 1)];
|
||||||
dbot.db.imgur.totalHttpRequests += 1;
|
dbot.db.imgur.totalHttpRequests += 1;
|
||||||
var image = request(testUrl, function(error, response, body) {
|
var image = request(testUrl, function(error, response, body) {
|
||||||
gm(new Buffer(body, 'binary')).size(function(e, val) {
|
// 492 is body.length of a removed image
|
||||||
// 492 is body.length of a removed image
|
if(!error && response.statusCode == 200 && body.length != 492) {
|
||||||
if(!error && response.statusCode == 200 && body.length != 492 &&
|
dbot.db.imgur.totalImages += 1;
|
||||||
val && val.height > 300 && val.width > 300) {
|
var hash = crypto.createHash('md5').update(body).digest("hex");
|
||||||
dbot.db.imgur.totalImages += 1;
|
if(_.has(dbot.modules, 'quotes')){
|
||||||
var hash = crypto.createHash('md5').update(body).digest("hex");
|
// autoadd: {"abcdef": "facebookman"}
|
||||||
if(_.has(dbot.modules, 'quotes')){
|
if(_.has(dbot.config.modules.imgur.autoadd,hash)){
|
||||||
// autoadd: {"abcdef": "facebookman"}
|
var category = dbot.config.imgur.autoadd[hash];
|
||||||
if(_.has(dbot.config.modules.imgur.autoadd,hash)){
|
if (_.contains(category, testUrl)){
|
||||||
var category = dbot.config.imgur.autoadd[hash];
|
// there's probably less than 62^5 chance of this happening
|
||||||
if (_.contains(category, testUrl)){
|
} else {
|
||||||
// there's probably less than 62^5 chance of this happening
|
dbot.api.quotes.addQuote(category, testUrl,
|
||||||
} else {
|
dbot.config.name, function() { });
|
||||||
dbot.api.quotes.addQuote(category, testUrl,
|
|
||||||
dbot.config.name, function() { });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
callback(testUrl, testSlug, hash);
|
|
||||||
} else {
|
|
||||||
this.api.getRandomImage(callback);
|
|
||||||
}
|
}
|
||||||
}.bind(this));
|
callback(testUrl, testSlug, hash);
|
||||||
|
} else {
|
||||||
|
this.api.getRandomImage(callback);
|
||||||
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user