From 508a79238936630f723a44e1b4f02900bc0506e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?iBug=20=E2=99=A6?= <7273074+iBug@users.noreply.github.com> Date: Tue, 15 Jan 2019 19:11:08 +0800 Subject: [PATCH] upvote others' "lost soul" comment --- saviour-of-lost-souls/saviour-of-lost-souls.user.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/saviour-of-lost-souls/saviour-of-lost-souls.user.js b/saviour-of-lost-souls/saviour-of-lost-souls.user.js index be0b4d2..c32df77 100644 --- a/saviour-of-lost-souls/saviour-of-lost-souls.user.js +++ b/saviour-of-lost-souls/saviour-of-lost-souls.user.js @@ -94,6 +94,17 @@ } }); } + + // Upvote all comments containing "welcome to" + comments.find("li").each(function() { + if ($(this).find("span.comment-copy")[0].innerText.toLowerCase().indexOf("welcome to") >= 0) { + // Click the "up" triangle + let upButtons = $(this).find("a.comment-up"); + if (upButtons.length > 0) { + upButtons[0].click(); + } + } + }); // You can't flag without 15 rep if (myReputation < 15) @@ -148,4 +159,4 @@ // TODO: reload page after all calls are finished }); -})(); \ No newline at end of file +})();