Originally Posted by konmehn
Originally Posted by Silver/
Sir konmehn ...

There's a block button. But look up my post history - the greasemonkey script I wrote is 100 times better, I'm quite proud of it. Just add my name to array I provided there, squire - it's getting a bit too surreal...


// ==UserScript==
// @name Larian Forums Blacklist
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// ==/UserScript==

const BLACK_LIST = [
'hated person'
];

const USER_REMOVED_TEXT = 'bye bye';

const findUserMatch = (userName) => {
const matchedUser = BLACK_LIST.find(u => u === userName);

return matchedUser;
}

const isThreadPage = () => {
return $('.author-content').length > 0;
}

const searchAndRemoveUser = () => {
const users = $('.username');

users.each(function() {
const user = $(this);

if (findUserMatch(user.text())) {
user.parents('.t_outer').remove();
}
});
}

const searchAndRemoveQuotes = () => {
const quotes = $('.ubbcode-header');

if (quotes.length > 0) {
quotes.each(function() {
const quote = $(this);
const quotedUser = quote.text().split(' ')[3] || null;

if (findUserMatch(quotedUser)) {
quote.parents('.ubbcode-block').remove();
}
});
}
}

const searchLinksAndRemoveUser = () => {
$('a').each(function() {
const link = $(this);

if (findUserMatch(link.text().trim())) {
link.text(USER_REMOVED_TEXT);
}
});
}

const searchAuthoredByAndRemoveUser = () => {
$('.small').each(function() {
const authoredBy = $(this);
const authoredByUser = authoredBy.text().split(' ')[1] || null;

if (findUserMatch(authoredByUser)) {
authoredBy.text(USER_REMOVED_TEXT);
}
});
}

const cleanseThreadPage = () => {
searchAndRemoveUser();
searchAndRemoveQuotes();
searchLinksAndRemoveUser();
}

const cleanseGeneralPages = () => {
searchLinksAndRemoveUser();
searchAuthoredByAndRemoveUser();
}

const blackListUsers = () => {
(isThreadPage()) ? cleanseThreadPage() : cleanseGeneralPages();
}

blackListUsers();



It's a very good script - very good...
Unfortunately, your replies fell short of earning this exclusive spot.

You must know, in my mind cinema, there was you, monologuing, while the "plot" of spore hung over your head. Emphases on "worst ever" echoed thought-out the room. A blue critter made eye contact with me. Its improbable round, stupid eyes unaware of the honour awarded while I realize in horror, this may count. And it might count for every low budget indie game.

I simply must know more of the mind behind this conclusion. It is fascinating.