Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         RBXSpamTrasher
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  try to take over the world!
  6. // @author       You
  7. // @match        https://www.roblox.com/library/*/*
  8. // @grant        none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12.     'use strict';
  13.  
  14.     var spamContains = [
  15.         "that means you're qualified",
  16.         "Want ROBUX?",
  17.         "No info or downloads",
  18.         "Instantly receive your ",
  19.         "Just get a code, and redeem here",
  20.         "You're eligible for BUX",
  21.         "Processed Instantly for tons of",
  22.         "Visit the link: ",
  23.         "Go see the link: ",
  24.         "Redeem your BUX now",
  25.         "No details needed! Unlock",
  26.         "Go to the link: ",
  27.         "New rewards site with instant BUX and passes",
  28.         "finish a quick offer to get the option",
  29.         "ROBUX piles coming your way",
  30.         "Unlock ALL Game VIP",
  31.         "rewardbuddy",
  32.         "instantreward"
  33.  
  34.     ];
  35.     var loadStep = 20;
  36.  
  37.     Array.from(document.getElementsByClassName("comments-item-template")).forEach(function(element, index, array){
  38.         element.getElementsByTagName("div")[0].style.display = 'none';
  39.     });
  40.  
  41.     var cln;
  42.  
  43.     function initializeFakeLoader(){
  44.         Array.from(document.getElementsByClassName("loading-animated")).forEach(function(element, index, array) {
  45.             element.style.display = 'none';
  46.         });
  47.  
  48.         Array.from(document.getElementsByClassName("loader-template")).forEach(function(element, index, array) {
  49.             cln = element.getElementsByTagName("div")[0].cloneNode(true);
  50.             element.getElementsByTagName("div")[0].style.display = 'none';
  51.         });
  52.  
  53.         var contain = document.getElementById("AjaxCommentsContainer").getElementsByTagName("div")[1]
  54.         contain.insertBefore(cln, contain.childNodes[6]);
  55.         cln.style.display = '';
  56.         Array.from(document.getElementsByClassName("btn-control-sm rbx-comments-see-more")).forEach(function(element, index, array) {
  57.             element.style.visibility = 'hidden';
  58.         });
  59.     }
  60.     initializeFakeLoader();
  61.     var stillLoading = true;
  62.     var iters = 0;
  63.     var nonSpam = 0;
  64.  
  65.     Array.from(document.getElementsByClassName("btn-control-sm rbx-comments-see-more")).forEach(function(element, index, array) {
  66.         element.onclick = function(){
  67.             if((!(element.classList.contains("hidden"))) && nonSpam >= loadStep){
  68.                 nonSpam = 0;
  69.                 iters = 0;
  70.                 stillLoading = true;
  71.                 initializeFakeLoader();
  72.             }
  73.         };
  74.     });
  75.     setInterval(function() {
  76.  
  77.         if((!stillLoading) && (cln.parentNode)){
  78.             cln.parentNode.removeChild(cln);
  79.             Array.from(document.getElementsByClassName("loader-template")).forEach(function(element, index, array) {
  80.                 element.getElementsByTagName("div")[0].style.display = '';
  81.             });
  82.             Array.from(document.getElementsByClassName("btn-control-sm rbx-comments-see-more")).forEach(function(element, index, array) {
  83.                 element.style.visibility = '';
  84.             });
  85.         }
  86.  
  87.         Array.from(document.getElementsByClassName("btn-control-sm rbx-comments-see-more")).forEach(function(element, index, array) {
  88.             if ((!(element.classList.contains("hidden"))) && nonSpam < loadStep) {
  89.                 iters++;
  90.                 element.click();
  91.                 stillLoading = true
  92.             }else{
  93.                 stillLoading = false
  94.             }
  95.         });
  96.  
  97.         Array.from(document.getElementsByClassName("comment-content list-content")).forEach(function(element, index, array) {
  98.             if(element.alreadyCheck != "true"){
  99.                 var isSpam = false;
  100.                 spamContains.forEach(function(a, b, c){
  101.                     if (element.innerHTML.indexOf(a)>=0){
  102.                         element.parentNode.parentNode.style.display = 'none';
  103.                         isSpam = true;
  104.                     }
  105.                 });
  106.                 if(element.innerHTML == "text"){
  107.                     isSpam = true;
  108.                 }
  109.                 if (isSpam == false){
  110.                     nonSpam++;
  111.                     element.parentNode.parentNode.style.display = '';
  112.                 }
  113.                 element.alreadyCheck = "true";
  114.             }
  115.         });
  116.  
  117.  
  118.  
  119.     }, 600);
  120. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement