User Controls

Greasemonkey Script for Blocking Posts Based on Various Conditions

  1. #1
    gadzooks Dark Matter [keratinize my mild-tasting blossoming]
    So, 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.
    The following users say it would be alright if the author of this post didn't die in a fire!
  2. #2
    gadzooks Dark Matter [keratinize my mild-tasting blossoming]
    Ahh, no more dick spam.

    Here's an example of it in action:

  3. #3
    Sophie Pedophile Tech Support
    GreaseMonkey script looks a lot like JavaScript. Hey, talk about JS. Are you familiar with NodeJS?
  4. #4
    gadzooks Dark Matter [keratinize my mild-tasting blossoming]
    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.
  5. #5
    gadzooks Dark Matter [keratinize my mild-tasting blossoming]
    I 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...

  6. #6
    gadzooks Dark Matter [keratinize my mild-tasting blossoming]


  7. #7
    Ghost Black Hole
    I was the most blocked user on RDFRN and I would like my prestigious title back

    time to fire up the old spam cannon
  8. #8
    Ghost Black Hole
    You know he's a chad because all of his alts have the same name.
  9. #9
    Soyboy V: A Cat-Girl/Boy Under Every Bed African Astronaut [my no haunted nonbeing]
    Using the user id is clever.
  10. #10
    Ghost Black Hole
    You are blocking our plurals, your loss!

    We grow 1 new plural every day.
  11. #11
    gadzooks Dark Matter [keratinize my mild-tasting blossoming]
    Ok 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>";
    };

    };
    };
  12. #12
    Mahmoud Houston
    I made one for Tampermonkey specifically to block TDR a long time ago. Thank goodness he's fucked off.
  13. #13
    GGG victim of incest [my veinlike two-fold aepyornidae]
    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.
  14. #14
    Mahmoud Houston
    Gaydzooks
  15. #15
    GGG victim of incest [my veinlike two-fold aepyornidae]
    Can you fuck off gadzooks already idk how you even got into a thing with him he's like the nicest dude ever
    The following users say it would be alright if the author of this post didn't die in a fire!
  16. #16
    Sophie Pedophile Tech Support
    Originally posted by Ghost I was the most blocked user on RDFRN and I would like my prestigious title back

    time to fire up the old spam cannon

    Remember when Gun Lover banned Sploo? Back at Zoklet? He literally got 50+ thanks for it. I think Sploo is the undisputed ruler of the mongolvoid.
  17. #17
    Mahmoud Houston
    Originally posted by GGG Can you fuck off gadzooks already idk how you even got into a thing with him he's like the nicest dude ever

    GayGayGay
  18. #18
    gadzooks Dark Matter [keratinize my mild-tasting blossoming]
    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.
  19. #19
    gadzooks Dark Matter [keratinize my mild-tasting blossoming]
    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.
  20. #20
    Mahmoud Houston
    Yes, 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.
Jump to Top