Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

userscript support throd

Name: aeosynth !zdxFBW2hCw 2010-02-14 21:28

instead of registering on us.o just to make one post, you can use this thread. questions, comments, feature requests, patches are all fine.

I'll provide support for everything listed at http://userscripts.org/users/64431/scripts.

Name: Anonymous 2010-02-22 16:20

Hey I'm using this thread filter but I get bands where the threads are hidden.


// ==UserScript==
// @name ShiichanFilter
// @namespace 4ch
// @include http://dis.4chan.org/*;
// ==/UserScript==
function gcl(vclass){return document.getElementsByClassName(vclass)}
var filt=/test1|text2|text3/gim;
var filt2=/name1|name2|name3/gim;
var filt3=/thread1|thread2|thread3/gim; //Links/threadnames
function tag(x,y){if(!y){return document.getElementsByTagName(x)}else{return x.getElementsByTagName(y)}};
function sa(x,y,z){x.setAttribute(y,z)};
var posts=tag('blockquote');var pl=posts.length;//hide by text
for(var d=0;d<pl;d++){if(posts[d].innerHTML.search(filt)!=-1){sa(posts[d].parentNode,'style','display:none')}else{sa(posts[d].parentNode,'style','display:inline')}}
var ss2=gcl("postername");//hide by postername
for(var d=0;d<pl;d++){if(ss2[d].innerHTML.search(filt2)!=-1){sa(ss2[d].parentNode.parentNode.parentNode,'style','display:none')}}
var st2=gcl("replies");//hide entire thread
for(var d in st2){if(st2[d].parentNode.innerHTML.search(filt3)!=-1){sa(st2[d].parentNode.parentNode.parentNode,"style","display:none")}}
var sd2=tag("a");//hide thread from links
for(var d in sd2){if(sd2[d].innerHTML.search(filt3)!=-1){sa(sd2[d],"style","display:none");}}


Is there a way to modify the above code to make it hide threads the way this script does? :



var threads, thread;
threads = document.evaluate("//div[@class='border']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0; i < threads.snapshotLength; i++) {
  thread = threads.snapshotItem(i);
  if (-1 != thread.childNodes[3].childNodes[3].childNodes[1].childNodes[1].textContent.search(/200[4-8]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]/g)) {
      thread.style.display = "none";
  }
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List