Howto Filter some messages in rubyforum

Hello,

When we consult rubyforum by http, it is not directly possible
to filter messages.

So, for firefox users, here is a little GreaseMonkey script for
filter by author’s name :

// ==UserScript==
// @name author filter Threads
// @description supress some thread un rubyforum, based on author’s
name
// @copyright R.Aubarede
// @include http://www.ruby-forum.com/forum/*
// ==/UserScript==

// OPTIONS

/////////////////////////////////////////////////////////////////////////
var blacklist = new Array(/Ili.*\s+Lazar/gi);
/////////////////////////////////////////////////////////////////////////

var nb=0;
var links = document.evaluate("//td[@class=‘author’]",
document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
for(var i=links.snapshotLength-1; i>=0; i–) {
var tag = links.snapshotItem(i);
var author= tag.textContent;
if (tag.parentNode.parentNode)
for(var x=blacklist.length-1; x>=0; x–)
if (author.match(blacklist[x])) {
tag.parentNode.parentNode.removeChild(tag.parentNode);
nb+=1;
}
}
if (nb>0) {
var header1=document.evaluate(
“//table/tbody/tr/th[@class=‘subject’]”,
document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null)
.snapshotItem(0);
header1.textContent=“Subject (”+nb+" filters!)";
}

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs