From f851e22e8bb98e830bf69ec5a4d2731401abe9af Mon Sep 17 00:00:00 2001 From: doppeldeveloper Date: Sat, 2 Dec 2017 21:44:12 +0000 Subject: [PATCH] update to allow for phone number variations some spam profiles vary on their formatting of the spam number, so let's do a regex test instead. also, removed some superfluous space characters. --- destroy-spammer/destroy-spammer.user.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/destroy-spammer/destroy-spammer.user.js b/destroy-spammer/destroy-spammer.user.js index 51742cc..c0c5ad4 100644 --- a/destroy-spammer/destroy-spammer.user.js +++ b/destroy-spammer/destroy-spammer.user.js @@ -3,7 +3,7 @@ // @namespace https://github.com/Glorfindel83/ // @description Adds a 'Destroy spammer' link for moderator on user profiles with only deleted posts. // @author Glorfindel -// @version 0.4.2 +// @version 0.4.3 // @match *://*.stackexchange.com/users/* // @match *://*.stackoverflow.com/users/* // @match *://*.superuser.com/users/* @@ -58,14 +58,14 @@ // Add to document moderatorLinkElement.after(destroyLink); - }; + }; // Check for keywords in spammers' profiles $.get(document.location.href.split('?')[0] + "?tab=profile", function (data) { - if (data.contains("1-844-909-0831")) { + if (data.search(/1\D844\D909\D0831/g)) { createDestroyLink(userID); } - }); + }); // Check for (deleted) questions and answers var questionsPanel = $('#user-panel-questions'); @@ -84,5 +84,5 @@ return; // Create Destroy link immediately - createDestroyLink(userID); + createDestroyLink(userID); }) ();