Skip to content

Instantly share code, notes, and snippets.

@youpy
Forked from swdyh/tweets_filter.user.js
Created April 13, 2010 02:44
Show Gist options
  • Save youpy/364260 to your computer and use it in GitHub Desktop.
Save youpy/364260 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|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