Universal Hub Killfile

Filters out posts on universalhub.com by users who are known to argue in bad faith.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name        Universal Hub Killfile
// @description Filters out posts on universalhub.com by users who are known to argue in bad faith.
// @require     https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @include     http*://*universalhub.com/*
// @version     1.02
// @namespace https://greasyfork.org/users/41970
// ==/UserScript==

var usernameList = [
    "O-FISH-L",
    "Markk02474",
    "StillFromDorchester",
    "bosguy22",
    "Republican",
    "Doug1001"];

var curIdIndex = 0;
$('div[class="comment clearfix"]').filter(function(idx) {

    var authorUrl = $(this).find('.username')[0].toString();
    // If this is a registered user, we now have a handle to their full
    // profile page.  Otherwise we have an object that swe need to pull the
    // first child out of
    var author;
    if (authorUrl.indexOf("http://www.universalhub.com/users") != -1) {
        author = authorUrl.substring(34);
    } else {
        author = $(this).find('.username')[0].innerHTML;
    }
    for (var ii = 0; ii < usernameList.length; ii++) {
        if (author.toLowerCase().indexOf( usernameList[ii].toLowerCase() ) > -1) {
            var curUser = usernameList[ii].toLowerCase();
            curIdIndex++;
            // Hide the title div
            $(this).prev().css("display", "none");
            $(this).prev().attr("id", "title_" + curIdIndex);

            // Swap out the offending text
            $(this).attr("id", "comment_" + curIdIndex);
            $(this).html("<div>Hid comment by " + usernameList[ii] + "</div>");

            // Check to see if the following section is indented below this one, which
            // indicates that it's a response.  If so, hide it as well.
            if (typeof $(this).next().attr("class") != "undefined") {
                var classList = $(this).next().attr("class").split(/\s+/);
                for (var i = 0; i < classList.length; i++) {
                    if (classList[i] === 'indented') {
                        $(this).next().css("display", "none");
                        $(this).next().attr("id", "indent_" + curIdIndex);
                    }
                }
            }
            return true;
        }

    }
    return false;
});