Created
April 1, 2022 18:42
-
-
Save ninjastic/580bbe7aeff5eaf0d20c41346587d6e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Low IQ Filter | |
// @version 0.1 | |
// @description Filters the wasted space of the forum out | |
// @author TryNinja | |
// @match https://bitcointalk.org/index.php?topic=* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=bitcointalk.org | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const MIN_IQ = 160; | |
const posts = document.querySelectorAll("#quickModForm > table.bordercolor > tbody > tr > td > table"); | |
posts.forEach(post => { | |
const userIq = post.querySelector("td.poster_info > div > b"); | |
if (!userIq) return null; | |
const userIqValue = Number(userIq.textContent.match(/IQ: ([0-9]+)/)[1]); | |
if (userIqValue < MIN_IQ) { | |
const postContentTd = post.querySelector('td.td_headerandpost'); | |
const postAuthorUsername = post.querySelector('td.poster_info > b > a'); | |
postContentTd.innerHTML = `Post ignored because the author's IQ is too low (imagine having less than ${MIN_IQ} IQ LOL)`; | |
postAuthorUsername.innerHTML = 'LOW IQ DUMMY!' | |
userIq.textContent = `${userIq.textContent} 🤣` | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment