Greasy Fork

Greasy Fork is available in English.

屏蔽雪球机器人

屏幕雪球上用户id为用户加数字的垃圾用户!

当前为 2023-06-27 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         屏蔽雪球机器人
// @namespace    cyqtest
// @version      1.0
// @description  屏幕雪球上用户id为用户加数字的垃圾用户!
// @author       devil
// @match        https://xueqiu.com/*
// @icon         https://assets.imedao.com/ugc/images/profiles/new/identity_icon_7-291fac8d46.png
// @grant        none
// @run-at  document-end
// @license test
// ==/UserScript==

(function() {
    'use strict';
    console.log("location.hostname:",location.hostname);
    let userInfo;
    if (document.domain == 'xueqiu.com'){
        //过滤雪球机器人用户
        setTimeout(() => {
        let ops =document.querySelector('.status-list');
        filter(ops);
        ops.addEventListener("DOMNodeInserted", function(event) {
            filter(ops)
        });
        }, 1000);
    };

    function filter(root){
        let regEx = /用户(\d*)/g
        userInfo = root.querySelectorAll("article.timeline__item");
        for (var index=0;index<userInfo.length;index++){
            let userName = userInfo[index].getElementsByClassName("user-name")[0];
            let user_id = userName.innerText.match(regEx);
            if (user_id){
                userInfo[index].style.display = 'none';
                console.log('删除"' + user_id + '的帖子')
            }
        }
    }
    // Your code here...
})();