本地黑名单-哔哩哔哩

我的地盘,我做主!

当前为 2020-05-22 提交的版本,查看 最新版本

// ==UserScript==
// @name         本地黑名单-哔哩哔哩
// @namespace    http://tampermonkey.net/
// @version      0.1.1
// @description  我的地盘,我做主!
// @author       lavaf
// @match        https://www.bilibili.com/video/*
// @grant        none
// @require         https://cdn.bootcss.com/jquery/3.4.1/jquery.js
// ==/UserScript==

(function() {
    'use strict';
    let blackList=['5942248','38257770','1715577','95414253','11374267','192534943','80004783','129872455',
        '14753117','345938075','270020512','15884281','299728568','328743982','38101837','320788365','400938613',
        '371985983','276243252','198827461','360103800','321652']
    setInterval(function () {
        console.log('hello')
        let nameList=$("a.name");
        nameList.each(function (i,e) {
            if ($(e).attr('data-lavaf') !== '1') {
                let id = $(e).attr("data-usercard-mid");
                for (const blackListKey in blackList) {
                    if (blackList.hasOwnProperty(blackListKey)) {
                        if (blackList[blackListKey] === id) {
                            //console.log(id);
                            $(e).text(id)
                            let user= $(e).parent();
                            if (user.children().length ===   3) {
                                user.children("span").text("此用户已经被屏蔽");
                            } else {
                                user.next().text("此用户已经被屏蔽")
                            }
                            $(e).attr('data-lavaf','1');
                        }
                    }
                }
            }

        });
    },500)

})();