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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | // ==UserScript==
// @name 4chan Fumigation Protocol
// @namespace local
// @version 4.0
// @match https://boards.4chan.org/e/thread/*
// @author !SX2ZRK62WM
// @grant none
// ==/UserScript==
(function () {
'use strict';
const LETHAL_DOSAGE = 70;
const BUG_SIZE = 900;
const _0x5f21 = [55, 2, 2, 2, 5, 10, 10, 7, 7, 5, 50, 5, 5, 55, -10, -35, -5, -35];
const hiveCore = document.querySelector('.subject');
if (!hiveCore) return;
const isContaminated = hiveCore.textContent.toLowerCase().includes('/edg/');
if (!isContaminated) return;
function getIncubationPeriod(specimen) {
const pulse = specimen.querySelector('time');
if (!pulse) return null;
const timeLog = pulse.getAttribute('datetime');
return timeLog ? new Date(timeLog).getTime() : null;
}
function dissectPathogen(specimen) {
const residue = specimen.querySelector('.fileText');
if (!residue) return null;
const link = residue.querySelector('a');
if (!link) return null;
const tag = link.textContent || '';
const rawData = residue.textContent || '';
const massMatch = rawData.match(/\(([\d.]+)\s*(KB|MB)/i);
let weight = null;
if (massMatch) {
const mag = parseFloat(massMatch[1]);
const scale = massMatch[2].toUpperCase();
weight = scale === 'MB' ? mag * 1024 : mag;
}
const secretion = specimen.querySelector('.postMessage');
const content = secretion ? secretion.textContent.trim() : '';
return { tag, weight, content };
}
function assessInfestation(specimen) {
const data = dissectPathogen(specimen);
if (!data) return { ppm: 0 };
let ppm = 0;
const label = data.tag;
if (data.weight !== null && data.weight < 150) ppm += 35;
if (data.weight !== null && data.weight < BUG_SIZE) ppm += _0x5f21[0];
if (data.weight !== null && data.weight > 2072) ppm += _0x5f21[17];
if (/\s/.test(label)) ppm += _0x5f21[14];
const serialMatch = label.match(/^(\d+)-/);
if (serialMatch) {
if (serialMatch[1].length == 5 && parseInt(serialMatch[1], 10) > 50) {
ppm += _0x5f21[10];
}
}
if (label.replace(/\.[^.]+$/, '').length < 10) ppm += _0x5f21[4];
if (/[a-zA-Z]{6,}/.test(label)) ppm += _0x5f21[11];
if (/[-_][a-zA-Z0-9][-_]/.test(label)) ppm += _0x5f21[12];
if (label.includes('_')) ppm += _0x5f21[1];
if (label.includes('-')) ppm += _0x5f21[2];
if (label.includes('_') && label.includes('-')) ppm += _0x5f21[3];
if (/\d[a-zA-Z]\d/.test(label)) ppm += _0x5f21[5];
if (/[a-zA-Z]\d[a-zA-Z]/.test(label)) ppm += _0x5f21[6];
if (/[aeiou]{3}/i.test(label)) ppm += _0x5f21[7];
if (/[A-Z]{3}/.test(label)) ppm += _0x5f21[8];
if ((label.match(/[A-Z]/g) || []).length >= 3) ppm += _0x5f21[9];
if (data.content.length > 0) ppm += _0x5f21[16];
return { ppm };
}
function applyFumigant(specimen) {
if (specimen.dataset.purged) return;
specimen.dataset.purged = 'true';
const nest = specimen.closest('.postContainer') || specimen;
nest.remove();
}
function scanBiohazard() {
const samples = [...document.querySelectorAll('.post.reply:has(.file)')];
let lastPulse = null;
for (const unit of samples) {
const report = assessInfestation(unit);
const currentPulse = getIncubationPeriod(unit);
if (currentPulse && lastPulse) {
const delta = (currentPulse - lastPulse) / 1000;
if (delta < 60) report.ppm += _0x5f21[13];
else if (delta > 100) report.ppm += _0x5f21[15];
}
if (currentPulse) lastPulse = currentPulse;
if (report.ppm >= LETHAL_DOSAGE) {
applyFumigant(unit);
}
}
}
scanBiohazard();
const breedingGround = document.querySelector('.thread');
if (breedingGround) {
const exterminator = new MutationObserver((logs) => {
if (logs.some(l => l.addedNodes.length > 0)) {
scanBiohazard();
}
});
exterminator.observe(breedingGround, {
childList: true,
subtree: false
});
}
})();
|
Install violentmonkey/tampermonkey and paste the code as a new userscript.
The updates will not always be announced. Come and check periodically for updates.
