[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/wsr/ - Worksafe Requests

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: 1735700293107943.jpg (249 KB, 1920x1080)
249 KB
249 KB JPG
What can filter 4chan posts by a list of words of regexes?
I don't want to run 4chan-x. I don't want mobile shit. Just the normal 4chan website and an unintrusive script that hides recurring shitposts of my choice.
>>
A bit manual to update, but Tampermonkey + ChatGPT code works fine for this. Whipped this up real quick and it seems to work fine. You might need to figure out how to turn on developer mode or enable scripts for whatever browser you use but that should be pretty doable. Downside is that you need to manually add the regex to the array whenever you have something new to block.
// ==UserScript==
// @name 4chan Thread Filter
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Hide 4chan threads matching certain regexes
// @match *://boards.4chan.org/*
// @grant none
// @run-at document-idle
// ==/UserScript==

(function() {
'use strict';

const regexList = [
/shiggy\s*diggy/i,
];

const removeCompletely = false; // true = delete from DOM
const threadSelector = '.thread, .catalog-thread';

function filterThreads() {
document.querySelectorAll(threadSelector).forEach(thread => {
const text = thread.innerText || '';
if (regexList.some(rx => rx.test(text))) {
if (removeCompletely) {
thread.remove();
} else {
thread.style.display = 'none';
}
}
});
}
console.log('script running');
window.addEventListener('load', () => setTimeout(filterThreads, 1000));

const observer = new MutationObserver(filterThreads);
observer.observe(document.body, { childList: true, subtree: true });
})();
>>
>>
>>1544841
I like how you completely ignored OP's second sentence.
>>
>>1544841
>>1544847
Something like this would be OK. But that code seems to be for threads only.

>>1544845
I thought that was for threads only. The UI tricked me into thinking that because the [Filters] link is only on the catalog view.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.