本地黑名单-知乎

我的地盘,我做主!

目前为 2020-05-24 提交的版本。查看 最新版本

// ==UserScript==
// @name         本地黑名单-知乎
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  我的地盘,我做主!
// @author       lavaf
// @match        https://www.zhihu.com/question/*
// @match        https://www.zhihu.com/question/*/answer/*
// @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']
    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');
                        }
                    }
                }
            }

        });
        let List=$("div.AnswerItem");
        List.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');
                        }
                    }
                }
            }

        });
    },500)

})();

QingJ © 2025

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