Skip to content

Instantly share code, notes, and snippets.

@snbk97
Last active July 23, 2019 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snbk97/a2929ad03514e7955815b4c33a156e06 to your computer and use it in GitHub Desktop.
Save snbk97/a2929ad03514e7955815b4c33a156e06 to your computer and use it in GitHub Desktop.
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