Created
March 3, 2020 23:14
-
-
Save scragg0x/773c09a6ff22f1f0234418c27a75adb2 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
(function FakeNewsify() { | |
String.prototype.sarcasm = function(x) { | |
return ((x || this).match(/.{1,2}/g) || []).map(s => s[0].toUpperCase() + (s[1] || '').toLowerCase()).join(''); | |
}; | |
var el = document.getElementsByTagName('body')[0]; | |
var n, | |
a = [], | |
walk = document.createTreeWalker(el, NodeFilter.SHOW_TEXT, null, false); | |
while ((n = walk.nextNode())) a.push(n); | |
a.forEach(node => (node.nodeValue = node.nodeValue.toString().sarcasm())); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment