-
-
Save youpy/364260 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// ==UserScript== | |
// @name tweets_filter | |
// @namespace http://www.relucks.org/ | |
// @include http://twitter.com/ | |
// ==/UserScript== | |
var re = /(4sq.com|htn.to|tou.ch|shindanmaker.com)/ | |
// var re = /(4sq.com|#example)/ | |
filter(document) | |
document.addEventListener("DOMNodeInserted", function(e){ | |
if (e.target.tagName) { | |
filter(e.target) | |
} | |
}, false) | |
function filter(node) { | |
Array.forEach(node.querySelectorAll('span.entry-content'), function(i) { | |
if (i.innerHTML.match(re)) { | |
var li = i.parentNode.parentNode | |
li.style.opacity = 0.2 | |
// li.style.display = 'none' | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment