mirror of
https://github.com/reality/dbot.git
synced 2024-11-23 20:39:25 +01:00
Merge pull request #451 from zuzak/borkborkbork
Add tracking for a certain hash
This commit is contained in:
commit
5fd7e2ca50
@ -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}'."
|
||||
|
@ -4,5 +4,9 @@
|
||||
"imagelength": 5,
|
||||
"nsfwwarn": true,
|
||||
"apikey": "86fd3a8da348b65",
|
||||
"highscore": "ricount"
|
||||
"highscore": "ricount",
|
||||
"autoadd": {
|
||||
"e49e686582ce3f60cb51d00c10924861": "facebookman",
|
||||
"b11b634c74562bcd4e5d17b0d90987be": "raffleguy"
|
||||
}
|
||||
}
|
||||
|
@ -52,6 +52,17 @@ 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(_.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);
|
||||
|
@ -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;
|
||||
}
|
||||
};
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user