Last active
April 27, 2018 13:16
-
-
Save gergelyszabo94/85dc4063011bce32b689478dedd59d6a to your computer and use it in GitHub Desktop.
CSGO Lounge Spam block
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Corresponding blog entry for more info: | |
//https://www.gergely-szabo.com/blog/csgoloungespamblock | |
// ==UserScript== | |
// @name CSGO Lounge Spam Block | |
// @namespace https://www.gergely-szabo.com/ | |
// @version 1.0 | |
// @description Deletes spam comments on trades and blocks it's sender on https://csgolounge.com/ | |
// @author Gergely Szabo | |
// @match https://csgolounge.com/trade?t=* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var messages = document.getElementById("messages"); | |
var repliesText = messages.querySelectorAll('div.msgtxt'); | |
var options = messages.getElementsByClassName("opts"); | |
var keywords = new RegExp('cṣgogem.com|nanotrade.win|lightshoț.com|You can trade it at ↑↑↑|çs.money|çsgolounge.money|imgụr.com|csgoreaper'); | |
for(var i=0; i < repliesText.length; i++){ //Goes through the list of replies and if it matches to a known spam pattern then deletes comment and blocks sender. | |
if(keywords.test(repliesText[i].innerText)){ | |
var buttons = options[i].getElementsByClassName("button"); | |
buttons[0].click(); | |
if(buttons.length>1){ | |
buttons[1].click(); | |
} | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added "csgoreaper" spam blocking.