You’ll have to forgive me and my lack of javascript knowledge.
Essentially I have seen a problem and a way of fixing it but the implementation is giving me some trouble.
Problem: a forum I know is being ruined by a frequent poster.
Solution: make a grease monkey script to make all the offending posts disappear.
Now I know that what I’m trying will work in some way but help getting it into a working state is gladly appreciated. The site in question is http://www.network54.com/Forum/188020 and what I want to do is every time the offending user posts a reply to a message the row with their reply is removed from the display.
soliloquy76 gave me this excellent code which would work great if network54 used id names for their tables, when I saved and edited the page to add an id field and tried it out, perfect, no more offending posts. So my next line of thought I had was to use javasript replace command to add an id to the table so the script could then remove the elements. At the moment I’m struggling to get the replace command to replace anything, can any of you see what I’m doing wrong, or is there a more eloquent solution to the problem?
Thank you for reading.
My non functional code:
// ==UserScript==
// @name Gerrie Who?!?
// @namespace xxx
// @description Removes Gerrie from .org
// @include *
// ==/UserScript==
/*************************************** ***************************************
* 1) finds the TR with the TD/DIV/@class='cnnStoryContent'
* 2) removes the last TD from the TR, which is the column with the ads in it
*/
(function()
{
document.body.innerHTML=document.body.in nerHTML.replace('cellpadding="6" cellspacing="1"','cellpadding="6" cellspacing="1" id="hi"');
var t = document.getElementById("hi")
for (var i=0; i < t.rows.length; i++) {
if (t.rows[i].innerHTML.indexOf("gerriedotf uckingkiss") != -1) {
t.rows[i].parentNode.deleteRow(t.rows[i] .rowIndex);
}
}
}
)();
Essentially I have seen a problem and a way of fixing it but the implementation is giving me some trouble.
Problem: a forum I know is being ruined by a frequent poster.
Solution: make a grease monkey script to make all the offending posts disappear.
Now I know that what I’m trying will work in some way but help getting it into a working state is gladly appreciated. The site in question is http://www.network54.com/Forum/188020 and what I want to do is every time the offending user posts a reply to a message the row with their reply is removed from the display.
Thank you for reading.
My non functional code:
// ==UserScript==
// @name Gerrie Who?!?
// @namespace xxx
// @description Removes Gerrie from .org
// @include *
// ==/UserScript==
/***************************************
* 1) finds the TR with the TD/DIV/@class='cnnStoryContent'
* 2) removes the last TD from the TR, which is the column with the ads in it
*/
(function()
{
document.body.innerHTML=document.body.in
var t = document.getElementById("hi")
for (var i=0; i < t.rows.length; i++) {
if (t.rows[i].innerHTML.indexOf("gerriedotf
t.rows[i].parentNode.deleteRow(t.rows[i]
}
}
}
)();
