Hide BPL Trolls

Hide forum postings from particular users on BPL

目前為 2015-09-27 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Hide BPL Trolls
// @namespace   ffmike
// @description Hide forum postings from particular users on BPL
// @include     http://www.backpackinglight.com/cgi-bin/backpackinglight/forums/*
// @version     1
// @domain      www.backpackinglight.com
// @license        CC0 1.0; https://creativecommons.org/publicdomain/zero/1.0/
// ==/UserScript==

// Shamelessly based on https://greasyfork.org/en/scripts/48-maximumpc-troll-remover/code
$(function () {
    console.log('Hiding trolls');
    var joList = ["TipiWalter",
                  "rosyfinch",
                 ];
    
    var joLength = joList.length;
    var numJoComments = 0;
                  
    var thisJo, userName, ref;
        
    // Rinse and repeat
    $("a").each(function(index, value) 
    {
        ref = value.href;
                  console.log(ref);
        
        userName = ref.substring(ref.lastIndexOf("?") + 3);
        for(var i=0; i<joLength; i++) 
        {
            if(userName == joList[i])
            {
                $(this).closest('table.thread_post').hide();
                break;
            }
        }
     });

});