User Controls
Greasemonkey Script for Blocking Posts Based on Various Conditions
-
2019-02-18 at 11:32 PM UTCSo, after over two decades of Internet exposure (I started with dial-up back before graphical browsers were even a thing), someone has finally come along that has actually made me feel the necessity for the capability to block users on an Internet forum. One poster in over 2 decades. I always thought blocking other users was for pussies, but there comes a point where it's just plain practical.
So, without further ado, I introduce you all to the first iteration of my script:
var posts = document.getElementsByClassName('post');
console.log(posts);
for (var i = 0; i < posts.length; i++) {
var post = posts[i];
var user = post.getElementsByClassName('user-block')[0].getElementsByTagName('a')[0];
var user_id = parseInt(user.href.split("/").slice(-1)[0]);
var user_name = user.innerText;
console.log(user_id);
console.log(user_name);
if (user_id > 5791) {
console.log("User, "+user_name+", has been blocked.");
post.innerHTML = "<div style='color: #D5DEE5;'>User, "+user_name+", has been blocked.</div>";
};
};
Now, there might very well be others out there, even specifically for NiS... No idea. But what this one currently does, is it basically just blocks posts from every user that has registered as of ~yesterday.
I'll probably tweak it to be more versatile over time, but for now, it's sufficient.
I would also add a search for "infinityshock", but, I imagine that would be pretty quickly overcome.
Also, this is clearly meant to be a temporary plugin, because it essentially "closes registration", in effect.
But it might be helpful for some of you right now.
If you don't use Firefox, I'm pretty sure there's an equivalent addon for Chrome and other browsers. -
2019-02-18 at 11:35 PM UTC
-
2019-02-18 at 11:39 PM UTCGreaseMonkey script looks a lot like JavaScript. Hey, talk about JS. Are you familiar with NodeJS?
-
2019-02-18 at 11:41 PM UTC
Originally posted by Sophie GreaseMonkey script looks a lot like JavaScript. Hey, talk about JS. Are you familiar with NodeJS?
Yeah I had heard of GreaseMonkey but never actually played around with it (until today). It turns out it's just like appending your own <script></script> block at the end of the document for every page that renders.
And yeah I have worked with Node before. Python (Flask for web frameworks) like infinitely more, but I have worked with Node. -
2019-02-18 at 11:51 PM UTCI also just realized that if one were so inclined, they could easily reverse word enhancements with a very slight modification of the above script (although they would have to store an entire associative array for each specific phrase and it's enhancemented result). I'm personally not bothered enough by the word enhancements to do that though, but it's a thought that occurred to me.
Also, one could make their own word enhancements, but that would probably get boring if you're the only one seeing them...
-
2019-02-19 at 12:22 AM UTC
-
2019-02-19 at 12:33 AM UTCI was the most blocked user on RDFRN and I would like my prestigious title back
time to fire up the old spam cannon -
2019-02-19 at 12:38 AM UTCYou know he's a chad because all of his alts have the same name.
-
2019-02-19 at 12:42 AM UTCUsing the user id is clever.
-
2019-02-19 at 12:48 AM UTCYou are blocking our plurals, your loss!
We grow 1 new plural every day. -
2019-02-19 at 1:30 AM UTCOk I just realized a potential issue with my original code...
It's probably better to wrap THE WHOLE THING in a conditional that first checks that you're even on NiS.
There's no point in having your browser search, well, anything, if you aren't on NiS (since the script's logic is based on how NiS is represented in terms of HTML and so on).
if (window.location.hostname === 'niggasin.space') {
ORIGINAL SCRIPT...
};
Or in full...
if (window.location.hostname === 'niggasin.space') {
var posts = document.getElementsByClassName('post');
for (var i = 0; i < posts.length; i++) {
var post = posts[i];
var user = post.getElementsByClassName('user-block')[0].getElementsByTagName('a')[0];
var user_id = parseInt(user.href.split("/").slice(-1)[0]);
var user_name = user.innerText;
console.log(user_id);
console.log(user_name);
if (user_id > 5791) {
console.log("User, "+user_name+", has been blocked.");
post.innerHTML = "<div style='color: #D5DEE5;'>User, "+user_name+", has been blocked.</div>";
};
};
}; -
2019-02-19 at 2:20 AM UTCI made one for Tampermonkey specifically to block TDR a long time ago. Thank goodness he's fucked off.
-
2019-03-02 at 3:57 AM UTCHey gadzooks I'm looking forward to the update.
I tried to figure out where it is that you specified 2-17 (the 'yesterday' when you made this thread) so I can update it as needed, but I'm way out of my element.
I think too, there are also users who have already registered a lot of alts. Maybe it would be more useful for posterity to have a specified blacklist, but I really have no idea how difficult that would be, I'm just throwing ideas because fuck infinityshock. -
2019-03-02 at 5:57 AM UTCGaydzooks
-
2019-03-02 at 6:16 AM UTCCan you fuck off gadzooks already idk how you even got into a thing with him he's like the nicest dude ever
-
2019-03-02 at 12:35 PM UTC
-
2019-03-02 at 12:50 PM UTC
-
2019-03-02 at 7:29 PM UTC
Originally posted by GGG Hey gadzooks I'm looking forward to the update.
I tried to figure out where it is that you specified 2-17 (the 'yesterday' when you made this thread) so I can update it as needed, but I'm way out of my element.
I think too, there are also users who have already registered a lot of alts. Maybe it would be more useful for posterity to have a specified blacklist, but I really have no idea how difficult that would be, I'm just throwing ideas because fuck infinityshock.
I just somewhat arbitrarily chose one of the dozen more recent infinityshock accounts and got the user ID number, then used a conditional that checks if the current poster's user ID was created after that account was created, then it blocks it if that's the case.
You could fairly easily play around with that one single integer (5791).
I'm going to update it with some more customizability very soon. -
2019-03-02 at 7:31 PM UTC
Originally posted by Mahmoud Gaydzooks
FUCKING CALLED IT!
Originally posted by gadzooks I'm tilting at windmills?
I'd wager dollars to donuts you'll find some way to drag this rivalry to yet another thread completely unprovoked.
When you don't have §m£ÂgØL's gonads on the brain, you're clearly obsessing over me. This is not the first thread where you've tried to mount me on first site.
Next time you do the same, I'm going to quote this post right here to stop that shit dead in its tracks before it turns into page after page of petty drama. -
2019-03-02 at 7:34 PM UTCYes, I explicitly posted that to triggered it. Did you get it out of your system?
Now I'm going to continue bullying you.
Nice prediction, stupid.