Sasquatch, GreaseMonkey script to ignore TTI users

bogz

Temporal Navigator
If you use FireFox there is a cool addon called "GreaseMonkey". It lets you write these things called user scripts that act on the HTML of any website.

These two scripts will let you ignore people on TTI. They only work with TTI but they can easily be modified to work on any forum that doesn't have an ignore feature.

This first script will make the trolls seemingly vanish off the face of the earth. You have to modify the line that begins with "var trolls" and set the username's of the people you don't want to hear from anymore. Their posts will be hidden, and so will the replies to anyone you deem a troll.

It's a work in progress, if a troll starts a new thread it still appears in the index for instance.

<pre><font class="small">code:</font><hr>
// ==UserScript==
// @name Sasquatch
// @namespace http://www.timetravelinstitute.ca/Sasquatch
// @description Ignore trolls on TTI
// @include http://www.timetravelinstitute.com/*
// ==/UserScript==

(function() {
function f() {
// Modify the line below with the users you dont like
var trolls = ['Pro7', 'Einstein'];
var as = document.getElementsByTagName("a");
for (var n=0,a;a=as[n];n++) {
for (var j=0; j &lt; trolls.length; j++) {
if (a.href.indexOf("User=" + trolls[j]) &gt; -1) {
var x = a.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
var y = x.nextSibling.nextSibling;
y.parentNode.removeChild(y);
x.parentNode.removeChild(x);
n--;
} else if (a.textContent.indexOf("re: " + trolls[j]) &gt; -1) {
var x = a.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
var y = x.nextSibling.nextSibling;
y.parentNode.removeChild(y);
x.parentNode.removeChild(x);
n -= 2;
}
}
}
}

f();
})();
</pre><hr>


This next script hides the forums that I don't like from the main index. So I only see the General Discussion area with "Off Topic" and "Real Science". This will be of less use but it's bug free, unlike the 1st one which will probably be an ongoing project.

<pre><font class="small">code:</font><hr>
// ==UserScript==
// @name Sasquatch2
// @namespace http://www.timetravelinstitute.ca/Sasquatch2
// @description Hide the fiction forums
// @include http://www.timetravelinstitute.com/*
// ==/UserScript==


(function() {
function f() {
var trolls = ['Time Travel', 'Aliens and UFOs', 'The Paranormal', 'Other Weird Stuff'];
var tds = document.getElementsByTagName("td");
for (var n=0,td;td=tds[n];n++) {
for (var j=0; j &lt; trolls.length; j++) {
if (td.textContent == "\n" + trolls[j] + "\n") {
var x = td.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
x.parentNode.removeChild(x);
n--;
}
}
}
}

f();
})();
</pre><hr>


Both scripts are released under the GPL v2
 
Re: Sasquatch, GreaseMonkey script to ignore TTI u

aww man, when I edit a thread with a link in it, the link gets all messed up.

I can fix that for you mods if you want. ;-)
 
Back
Top