Greasy Fork镜像 支持简体中文。

本地黑名单-知乎

我的地盘,我做主!

目前為 2020-05-27 提交的版本,檢視 最新版本

// ==UserScript==
// @name         本地黑名单-知乎
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  我的地盘,我做主!
// @author       lavaf
// @match        https://www.zhihu.com/question/*
// @match        https://www.zhihu.com/question/*/answer/*
// @match        https://www.zhihu.com
// @grant        none
// @require         https://cdn.bootcss.com/jquery/3.4.1/jquery.js
// ==/UserScript==

(function () {
    'use strict';
    ////www.zhihu.com/people/
    let blackList = ['la-la-la-la-la-55-20', 'mazhihang', 'song-ling-dao-jie-shou-huo-yan-jing-hua',
        'hong-liao-2', 'wang-tang-min', 'qing-er-wu-hen', 'li-wei-long-69', 'chen-yun-fei-14-82', 'su-mo-bu-pao-mo',
        'wgt-33', 'mao-cheng-wei', 'fan-ru-yun-98', 'zhang-zan-72', 'lancer-fz', 'tian-kong-zhi-shang-2', 'linyizy',
        'bbbleung', 'huajianduzhuo', 'saojikao', 'xiao-bao-de-a-ke', 'chen-yun-59-15', 'chen-bei-85-18',
        'bai-feng-nong-yu', 'stevenjau', 'xia-yun-xi-56', 'jeromewu', 'rodriguez-89', 'lan-de-qi-ming-81-72',
        'qiu-shui-luo-luo', 'tie-fo-ye', 'bdqd-67', 'si-tu-feng-79', 'gyi-liu', 'yin-wei-ta-shi-qiu-qiu', 'wang-ye-98-59',
        'da-tou-61-15', 'zhao-yi-19-56', 'sa-sa-78-68', 'chao-ji-wu-di-niang-niang-pao',
        'yangbingli', 'chen-xiao-pan-50', 'du-gu-bu-bai-79', 'Ofeet', 'maomaobear', 'ya-meng-su-ren', 'xia-mu-22-85-64',
        'la-la-la-63-18-88', 'winter-91-47', 'long-long-18-2', 'yong-yuan-bian-dong', 'hai-tao-ye-jiao-bei-ji-xiong',
        'liu-ying-jie-11-72', 'xiao-xiao-xiao-79-93']
    let hash=['0aafe9fcf86caa45f8aaaf345396916b']
    setInterval(function () {
        console.log('start')
        let nameList = $("div.CommentItemV2");
        nameList.each(function (i, e) {
            if ($(e).attr('data-lavaf') !== '1') {
                let id = $(e).find("a.UserLink-link").attr("href");
                for (const blackListKey in blackList) {
                    if (blackList.hasOwnProperty(blackListKey)) {
                        //console.log(id);
                        if ("//www.zhihu.com/people/" + blackList[blackListKey] === id) {
                            $(e).text(id + " 此用户已经被屏蔽")
                            $(e).attr('data-lavaf', '1');
                            break;
                        }
                    }
                }

            }

        });
        let List = $("div.AnswerItem");
        List.each(function (i, e) {
            if ($(e).attr('data-lavaf') !== '1') {
                let id = $(e).find('a.UserLink-link').attr("href");
                if (id == null) {
                    let extra = $(e).attr("data-za-extra-module");
                    let i= JSON.parse(extra).card.content.author_member_hash_id;
                    for (const h in hash){
                        if (hash.hasOwnProperty(h)) {
                            if (h == i) {
                                $(e).text(id + " 此用户已经被屏蔽")
                                $(e).attr('data-lavaf', '1');
                            }
                        }
                    }
                } else
                    for (const blackListKey in blackList) {
                        if (blackList.hasOwnProperty(blackListKey)) {
                            //console.log(id);
                            if ("//www.zhihu.com/people/" + blackList[blackListKey] === id) {
                                $(e).text(id + " 此用户已经被屏蔽")
                                $(e).attr('data-lavaf', '1');
                            }
                        }
                    }
                let name = $(e).find('span.AuthorInfo-name');
                //console.log('name:'+name);
                if (name.text() === '匿名用户') {
                    $(e).text(id + " 此用户已经被屏蔽")
                    $(e).attr('data-lavaf', '1');
                }
            }

        });
    }, 500)

})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址