Ignore User in altcoinstalks.com forum

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

目前為 2024-02-06 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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 {
}