-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXenForo Auto-Mod Approval Queue
More file actions
73 lines (61 loc) · 2.59 KB
/
XenForo Auto-Mod Approval Queue
File metadata and controls
73 lines (61 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// ==UserScript==
// @name XenForo Auto-Mod Approval Queue
// @namespace http://tampermonkey.net/
// @version 1.5
// @description Auto-select delete or approve in XenForo approval queue
// @match *://*/approval-queue*
// @grant none
// ==/UserScript==
(function () {
'use strict';
// List of phrases to flag as spam
const spamPhrases = [/Blacklisted site/i,
/\/\^\.\{1,3\}\$\//i,
/Anything new/i,
/legend/i,
/\/needs\? \(a \)\?\(big \)\?hero\/i/i,
/\/\^any heroe\?s\?\\s\*\(out there\)\?\\W\*\/im/i,
/matched \(\*cdn\*\.onlyfans\.com\*\)/i,
/matched \(n\*.coomer.su\)/i,
/matched \(img.coomer.su\)/i,
/\*no referrals\*/i
];
const approvePhrases = [/in forum Premium Site Requests/i,
/in forum Model Discussion/i,
/in forum General Discussion/i,
/Posted in thread "Who is this\?"/i
];
function isSpam(content) {
return spamPhrases.some(regex => regex.test(content));
}
function isGood(content) {
return approvePhrases.some(regex => regex.test(content));
}
function processItems() {
const queueItems = document.querySelectorAll('.message-inner'); // Adjust if your structure differs
let count = 0;
queueItems.forEach(item => {
const content = item.innerText;
const radios = item.querySelectorAll('input[type="radio"]');
const name = [...radios].find(r => r.value === 'approve')?.name;
if (!name) return;
const Delete = item.querySelector(`input[name="${name}"][value="delete"]`);
const approve = item.querySelector(`input[name="${name}"][value="approve"]`);
if (isGood(content)){
if (approve) approve.checked = true;
item.style.border = '2px solid green';
console.log('✅ Approved:', content.slice(0, 80));
}
if (isSpam(content)) {
if (Delete) Delete.checked = true;
item.style.border = '2px solid red';
console.log('🧹 Deleted:', content.slice(0, 80));
}
count++;
});
console.log(`✅ Processed ${count} moderation items`);
}
window.addEventListener('load', () => {
setTimeout(processItems, 1000);
});
})();