Last active
July 23, 2019 07:07
-
-
Save snbk97/a2929ad03514e7955815b4c33a156e06 to your computer and use it in GitHub Desktop.
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
javascript: (function() { | |
if (!(/(?:(irclogs|txt))$/g.test(window.location.href))) { | |
alert('Only works on DGPLUG irclogs pages'); | |
} | |
else if (!document.getElementById("hw-true")) { | |
var sp = document.body.innerHTML.split('\n'); | |
var ops = ['kushal', 'mbuf', 'bhavin192', 'chandankumar','sayan', | |
'jasonbraganza', 'maxking', 'praveenkumar', 'rtnpro', | |
'saptaks', 'schubisu', 'trishnag']; | |
var words = ['http', 'homework', 'home work', 'task']; | |
var hw = ''; | |
function checker(val) { | |
ops.forEach((op) => { | |
if (val.indexOf(op) > -1) { | |
words.forEach((word) => { | |
if (val.indexOf(word) > -1) { | |
hw += val; | |
hw += '\n'; | |
} | |
}) | |
} | |
}); | |
} | |
sp.filter(checker); | |
var p = document.createElement('p'); | |
p.setAttribute("id", "hw-true"); | |
p.innerHTML = '<br><h3>Homework</h3><pre>' + hw + '</pre>'; | |
document.body.appendChild(p); | |
} | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment