mirror of
https://github.com/reality/dbot.git
synced 2024-11-24 04:49:25 +01:00
how about this
This commit is contained in:
parent
4d130df390
commit
a9fdd82911
@ -79,12 +79,8 @@ 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) {
|
||||||
console.log(response.head);
|
gm(new Buffer(body, 'binary')).size(function(e, val) {
|
||||||
console.log(response.headers);
|
|
||||||
// 492 is body.length of a removed image
|
// 492 is body.length of a removed image
|
||||||
gm(body).size(function(err, val) {
|
|
||||||
console.log(err);
|
|
||||||
console.log(val);
|
|
||||||
if(!error && response.statusCode == 200 && body.length != 492 &&
|
if(!error && response.statusCode == 200 && body.length != 492 &&
|
||||||
val && val.height > 300 && val.width > 300) {
|
val && val.height > 300 && val.width > 300) {
|
||||||
dbot.db.imgur.totalImages += 1;
|
dbot.db.imgur.totalImages += 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user