Skip to content

Instantly share code, notes, and snippets.

@The-Quill
Last active February 5, 2016 01:20
Show Gist options
  • Save The-Quill/4682157263765d71c7e3 to your computer and use it in GitHub Desktop.
Save The-Quill/4682157263765d71c7e3 to your computer and use it in GitHub Desktop.
Disapproval Face disapproves your content
// ==UserScript==
// @name ಠ_ಠ
// @namespace https://gist.github.com/The-Quill/4682157263765d71c7e3
// @updateURL https://gist.github.com/The-Quill/4682157263765d71c7e3/raw/4b972e34ef4fb3f000ac9dae3aa92068b123664e/disapprovalface.user.js
// @downloadURL https://gist.github.com/The-Quill/4682157263765d71c7e3/raw/4b972e34ef4fb3f000ac9dae3aa92068b123664e/disapprovalface.user.js
// @version 3.0
// @description ಠ_ಠ
// @author Quill
// @match *://*/*
// ==/UserScript==
if (window.location.hostname == "chat.stackexchange.com"){
setTimeout(disapprove, 12000)
}
function disapprove(){
(function(startElement){
function recursiveIteration(element){
if (element.children.length == 0){
return textPropertyChange(element);
}
for (var i = 0; i < element.children.length; i++){
recursiveIteration(element.children[i]);
}
}
function textPropertyChange(element){
if ( element.tagName == "SCRIPT"
|| element.tagName == "STYLE"
|| element.tagName == "BR"
){ return false; }
if (element.innerText == "" || element.innerText == undefined){
if (element.textContent == "" || element.textContent == undefined){
return false;
}
element.textContent = convertText(element.textContent);
}
element.innerText = convertText(element.innerText);
}
function convertText(elementTextField){
return elementTextField.split('').map(function(){ return "ಠ_ಠ " }).join('');
}
recursiveIteration(startElement);
})(document.body);
}
disapprove();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment