Ignore User in altcoinstalks.com forum

2/2/2024, 12:32:37 PM

当前为 2024-02-06 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        Ignore User in altcoinstalks.com forum
// @namespace   Ignore User in altcoinstalks
// @match       https://www.altcoinstalks.com/index.php?*
// @grant       none
// @version     1.1
// @author      bitmover
// @license     MIT
// @description 2/2/2024, 12:32:37 PM
// ==/UserScript==


// Add all user you want to ignore in the list below //
const ignoredUsers = ['satoshi','Nakamoto'];

function removeUserPosts(ignoredUsers){
  const quickModForm = document.getElementById('quickModForm');
  const allPosts = quickModForm.querySelectorAll("[class^=windowbg]");

  for (let user of ignoredUsers){
    for (let post of allPosts) {
      if (post.querySelector('.poster h4').innerText === " "+user) {
        post.querySelector('ul').innerHTML = 'user is currently ignored';
        post.querySelector('.post').innerHTML = 'user is currently ignored';
        post.querySelector('.moderatorbar').innerHTML = '';
      }
    }
  }
}


function removeUserTopics(ignoredUsers){
  const tableGrid = document.getElementById('messageindex');
  const allTopics = tableGrid.querySelectorAll("tr:not(.catbg)");
    for (let post of allTopics) {
      if (ignoredUsers.some(user => post.querySelector('p').innerText.includes(user))) {
        post.innerHTML = '';
      }
    }
}
const url = window.location.href;
if (url.includes("board")) {
  removeUserTopics(ignoredUsers);
} else if (url.includes("topic")) {
  removeUserPosts(ignoredUsers);
} else {
}