Skip to content

Instantly share code, notes, and snippets.

@swdyh
Created March 19, 2010 15:38
Show Gist options
  • Save swdyh/337627 to your computer and use it in GitHub Desktop.
Save swdyh/337627 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name tweets_filter
// @namespace http://www.relucks.org/
// @include http://twitter.com/
// ==/UserScript==
var re = /(4sq.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