RK / nn.ru unwanted user posts and karma remover

// ==UserScript==
// @name         nn.ru unwanted user posts and karma remover
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Hides unwanted user topics, posts and karma at www.nn.ru
// @author       RK
// @match        https://www.nn.ru/*
// @grant        none
// @license         MIT
// ==/UserScript==


//Закомментируйте, если не требуется скрывать карму
window.onload = function removeKarma(){
    let karmas = Array.from(document.getElementsByClassName('karma'));
    for (let k of karmas){
        //console.dir(k + " removed");
        k.parentElement.remove();
    }
}


//setTimeout(function() {

//внесите id нежелательных юзеров
const FUCKER_IDS = [
    8581, //B-52
    4049, //vivat
    26447, //opeth
];

const RETAIN_TOPIC = false; //Оставлять тему в списке
const RETAIN_AUTHOR_ITEM = false; //Оставлять заглавное сообщение
const RETAIN_ANSWERED = false; //Оставлять ветки с ответами
const SHOW_REMOVED = true; //Показывать удаленные ники

let removedIDs = new Map();
function countRemoved(u) {
    let c = removedIDs.get(u) || 0;
    removedIDs.set(u, c + 1);
}

//console.time('time');
let prts = Array.from(document.getElementsByClassName('blueUrl PortraitLink'));
for (let p of prts){
    for(let fk of FUCKER_IDS) {
        if(/*p.hasAttribute('usid')
        &&*/ p.getAttribute('usid') == fk)
        {
            let branch = p.parentElement.parentElement.parentElement;
            if (RETAIN_AUTHOR_ITEM && branch.className == 'author-item')
                break;
            if (RETAIN_ANSWERED && branch.className != 'branch-last')
                break;
            branch.remove();
            if (SHOW_REMOVED) countRemoved(p.innerText);
            //console.log(p.innerText + " with id=" + fk + " destroyed.");
            break;
        }
    }
}

function showRemoved(className){
    let divToInsert = document.getElementsByClassName(className)[0];
    let div = document.createElement('div');
    div.innerHTML = "<strong>Removed: </strong>";
    for (let val of removedIDs)
        div.innerHTML += val[0] + "(" + val[1] + "), ";
    div.innerHTML = div.innerHTML.slice(0,-2);
    divToInsert.before(div);
}

if (SHOW_REMOVED && removedIDs.size > 0) {
    showRemoved('forum-item-cont');
    return;
}

//Topic list
let topics = Array.from(document.getElementsByClassName('author-cont'));
if (!RETAIN_TOPIC){
    for (let t of topics){
        for (let fk of FUCKER_IDS){
            if(t.children[1].getAttribute('usid') == fk){
                //console.log(t.children[1].innerText + " with id=" + fk + " destroyed.");
                t.parentElement.remove();
                if (SHOW_REMOVED) countRemoved(t.children[1].innerText);
                break;
            }
        }
    }

    if (SHOW_REMOVED && removedIDs.size > 0) showRemoved('forum-list-cont');
}

//console.timeEnd('time');

//}, 777);