Created
November 4, 2015 15:32
-
-
Save sageworksstudio/c5f08a87f56c3876cda1 to your computer and use it in GitHub Desktop.
Troll Remover for Mlive forums.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add troll names as a key/value pair: | |
* 'troll-name':'' | |
* Leave the value blank. | |
*/ | |
var theTrolls = {'some troll':'','another troll':''}, | |
getDivs = document.getElementsByTagName('div'), | |
divLength = getDivs.length, | |
i, | |
foundOne; | |
function trollAway() { | |
for (i = 0; i < divLength; i++) { | |
foundOne = getDivs[i].getAttribute('data-from'); | |
console.log(theTrolls); | |
if (foundOne in theTrolls) { | |
getDivs[i].parentElement.style.display = 'none'; | |
console.log(theTrolls + ' was removed!'); | |
} else {} | |
} | |
} | |
window.setInterval(trollAway, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment