Script to hide posts from chosen users on Pistonheads forum
Script to hide posts from chosen users on Pistonheads forum
Author
Discussion

budgie smuggler

Original Poster:

5,904 posts

180 months

Thursday
quotequote all
I've written a quick tampermonkey script to hide posts from chosen users on Pistonheads forum.

I hacked it together across a couple of lunch breaks so there might be a few bugs. Use at your own risk, YMMV, etc.

Works on Chrome and Firefox.
You will need Tamper Monkey browser extension installed.

On Chrome you will need to right click on the Tamper Monkey toolbar icon > Manage Extension > enable "Allow User Scripts"

You can then install the script by going to this page:

https://greasyfork.org/en/scripts/563614-pistonhea...

Then open a Pistonheads thread (or refresh one) and right click a user. Select block and their posts & quotes should disappear.




You can temporarily show the content by clicking it, or you can right click their username again to unblock them.

Note: currently this just blocks posts not entire threads.

If anything goes wrong just uninstall my script or Tamper Monkey itself.

Post up any bugs/feature requests etc. Enjoy your finely curated echo chamber ;-)




Who_Goes_Blue

1,376 posts

192 months

Thursday
quotequote all
Works great - but now every NP&E post I open is empty?

CSR Performance

165 posts

9 months

Thursday
quotequote all
Who_Goes_Blue said:
Works great - but now every NP&E post I open is empty?
biglaugh

camel_landy

5,355 posts

204 months

Thursday
quotequote all
budgie smuggler said:
I've written a quick tampermonkey script to hide posts from chosen users on Pistonheads forum.
bow

M

Xenoous

2,047 posts

79 months

Thursday
quotequote all
That's actually great. There's a few on NP&E that I just can't stand!

budgie smuggler

Original Poster:

5,904 posts

180 months

Thursday
quotequote all
Who_Goes_Blue said:
Works great - but now every NP&E post I open is empty?
hehe

weird, me too! biggrin

Road2Ruin

6,151 posts

237 months

Yesterday (06:29)
quotequote all
Xenoous said:
That's actually great. There's a few on NP&E that I just can't stand!
A few?!?!?

tim0409

5,580 posts

180 months

Yesterday (07:07)
quotequote all
The Trump thread has just been decimated when I blocked a single user smile

RustyMX5

8,943 posts

238 months

Yesterday (13:33)
quotequote all
There is already one as mentioned here.


https://www.pistonheads.com/gassing/topic.asp?h=0&...


And yes, the Trump thread is astonishingly quiet wink

budgie smuggler

Original Poster:

5,904 posts

180 months

Yesterday (14:17)
quotequote all
RustyMX5 said:
There is already one as mentioned here.


https://www.pistonheads.com/gassing/topic.asp?h=0&...


And yes, the Trump thread is astonishingly quiet wink
Probably wouldn't have bothered if I'd seen that! biglaugh

Oh well it seems like mine works a bit differently to all those in that thread anyway. Theirs completely nukes a user from the page as if they never existed. Mine obscures the post but leaves it clickable, so you can reveal the post/quote when you need to for the thread to make sense.

I do like Jagnet's idea to track member IDs so you can continue blocking them after a username change, I may stealborrow aspects of that idea for a future release.

Edited by budgie smuggler on Friday 23 January 14:20

unzippy

125 posts

259 months

Yesterday (14:22)
quotequote all
How about adding a feature so that the ignored user gets notified how many are ignoring them? biglaugh

Joseph Ducreux

5,805 posts

241 months

Yesterday (19:56)
quotequote all
budgie smuggler said:
RustyMX5 said:
There is already one as mentioned here.


https://www.pistonheads.com/gassing/topic.asp?h=0&...


And yes, the Trump thread is astonishingly quiet wink
Probably wouldn't have bothered if I'd seen that! biglaugh

Oh well it seems like mine works a bit differently to all those in that thread anyway. Theirs completely nukes a user from the page as if they never existed. Mine obscures the post but leaves it clickable, so you can reveal the post/quote when you need to for the thread to make sense.

I do like Jagnet's idea to track member IDs so you can continue blocking them after a username change, I may stealborrow aspects of that idea for a future release.

Edited by budgie smuggler on Friday 23 January 14:20
I did the original hacky jquery usermute script donkeys years ago (the original post is somewhere in website feedback), yours is way, way better!

I was half-heartedly writing an updated script last year as a v2 version, jokingly called "PH PBCD Mode" but decided that I couldn't be bothered any more!

This was how I was determining the member ID: (with standard parentheses after the function keywords, but PH's posting protection doesn't like it so 403s me). It's also part of the main loop of my script so the two nested .each statements obv need closing curlies/parens etc.

let postheadertags = window.jQuery(".msg-header");
postheadertags.each(function {
let authortags = window.jQuery(this).find(".js-author");

authortags.each(function {
let str = this.lastChild;
let name = this.innerText;
let memberid = String(str).match(/memberId=([^&]*)/);

The whole script ran on a loop across the page, determined the memberID per post then applied the block level (either removing the post completely, or blurring the content) and doing anything else that was needed on a per-member basis.

Keep going with yours - definitely! It'll make parts of this site actually bearable to go back into!!


Edited by Joseph Ducreux on Friday 23 January 20:02