Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Reddit Ban Editor - EFT Subreddit
- // @namespace https://reddit.com
- // @version 3.0
- // @description Tampermonkey script to replace the Reddit ban icon and message on r/EscapefromTarkov
- // @author You
- // @match https://www.reddit.com/r/EscapefromTarkov/*
- // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
- // @grant none
- // @run-at document-start
- // ==/UserScript==
- // Turns my tarkov reddit permanent ban message into a countdown for WW3.
- // This is the reply that got me banned btw: "Don't play Arenas. That's the sink for autist cheaters. Every game has someone that walks around like a bot with a crosshair locked on your forehead."
- // POSTED ONLINE: https://pastebin.com/9rxicG3N
- (function(){
- 'use strict';
- function getDaysUntil(dateStr) {
- const now = new Date();
- now.setHours(0, 0, 0, 0); // Start of today.
- const target = new Date(dateStr);
- target.setHours(0, 0, 0, 0); // Start of the target day.
- const diffTime = target - now;
- const diffDays = Math.round(diffTime / (1000 * 60 * 60 * 24));
- // return diffDays > 0
- // ? `${diffDays} day${diffDays !== 1 ? 's' : ''} remaining.`
- // : `Welcome to the Rice Fields! ☠`;
- // Shorter message. Needed to make room because WW3 sparks are multiplying.
- return diffDays > 0 ?
- `D-${diffDays}`:
- `D+${Math.abs(diffDays)} ☠`;
- }
- function generateMessage() {
- const events = [
- {
- label: 'German brigade fully deployed by end of 2027',
- date: '2027-12-31T12:00:00',
- },
- // https://www.al.com/news/2025/08/lockheed-exec-2028-deadline-for-golden-dome-missile-defense-shield-very-short-timeline.html
- // “And this can’t just be something that we put together for the first time and take it out to the field,” the director Amanda Pound, Lockheed Martin, added at the media briefing. “We have to test it. And there is a very short timeline between now and 2028 to get all this done and to do it in a way that we know will work.”
- {
- label: 'Golden Dome constellation deployment deadline 2028',
- date: '2028-01-01T00:00:00',
- },
- // https://www.politico.com/news/2025/11/18/top-army-officials-set-for-drone-focused-visit-to-ukraine-00658328
- // https://www.reuters.com/business/aerospace-defense/us-army-buy-1-million-drones-major-acquisition-ramp-up-2025-11-07/
- // During the Pentagon press conference this month, George, the Army’s top officer, added that in studying how Ukraine fights and adopts new technologies quickly, “what we picked up from them is really how you can go fast. And, you know, we’ve tried to replicate that” in Army rapid fielding and testing exercises.
- // The Army has set a target to buy 1 million drones over the next two to three years', a goal that is far beyond the U.S. defense industry’s current capacity, while Ukraine is already producing more than 1.5 million first-person view drones each year.
- //
- // https://www.nationaldefensemagazine.org/articles/2025/11/7/hegseth-declares-end-of-acquisition-system-as-you-know-it-tells-contractors-to-adapt-or-fade-away
- // Hegseth Declares End of Acquisition System ‘As You Know It,’ Tells Contractors to Adapt or ‘Fade Away’.
- // The new system will “dramatically shorten timelines, improve and expand the defense industrial base, boost competition and empower acquisition officials to take risks and make trade-offs,”
- // “Either you — our companies, our industries, our defense industrial base — deliver, or we fail. It is literally life or death,”
- {
- label: 'The Army has set a target to buy 1 million drones over the next two to three years',
- date: '2028-01-01T00:00:00',
- },
- ];
- return events
- .map(event => `💣 ${event.label}: ${getDaysUntil(event.date)}`)
- .join(' ');
- }
- function createEmojiIcon(emojiText = '🤠') {
- const emoji = document.createElement('span');
- emoji.textContent = emojiText;
- Object.assign(emoji.style, {
- fontSize: '28px',
- marginRight: '12px',
- lineHeight: '1em',
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- height: '100%',
- });
- return emoji;
- }
- function patchBanBanner() {
- const banner = document.querySelector('div[slot="post-banned-banner"]');
- if (!banner) return false;
- let patched = false;
- // Replace icon if not already replaced
- const icon = banner.querySelector('svg[icon-name^="ban"]');
- if (icon) {
- icon.replaceWith(createEmojiIcon());
- patched = true;
- }
- const msg = banner.querySelector('span.flex-auto');
- const newText = generateMessage();
- if (msg && msg.textContent.trim() !== newText) {
- msg.textContent = newText;
- patched = true;
- }
- return patched;
- }
- function patchUsernames() {
- const aliasMap = {
- 'bobbypower': 'stinkypete',
- };
- document.querySelectorAll('a[href^="/user/"], a[href^="https://www.reddit.com/user/"]').forEach(el => {
- const name = el.textContent.trim();
- if (aliasMap[name]) {
- el.textContent = aliasMap[name];
- }
- });
- }
- function patchFlairs() {
- const flairMap = {
- 'Papa Kalashnikov': '🤡 Vatnik',
- };
- document.querySelectorAll('.flair-content').forEach(el => {
- const title = el.textContent.trim();
- if (flairMap[title]) {
- el.textContent = flairMap[title];
- }
- });
- }
- function observeOnceBannerExists() {
- const tryInterval = setInterval(() => {
- const banner = document.querySelector('div[slot="post-banned-banner"]');
- if (banner) {
- clearInterval(tryInterval);
- patchBanBanner();
- patchUsernames();
- patchFlairs();
- const observer = new MutationObserver(() => {
- try {
- patchBanBanner();
- } catch (e) {
- console.warn('Reddit Ban Editor error:', e);
- }
- });
- observer.observe(document.body, { childList: true, subtree: true });
- }
- }, 250);
- }
- function setupSPAWatches() {
- const originalPushState = history.pushState;
- const originalReplaceState = history.replaceState;
- function triggerPatch() {
- setTimeout(() => {
- observeOnceBannerExists();
- patchBanBanner()
- patchUsernames();
- patchFlairs();
- }, 200);
- }
- history.pushState = function (...args) {
- originalPushState.apply(this, args);
- triggerPatch();
- };
- history.replaceState = function (...args) {
- originalReplaceState.apply(this, args);
- triggerPatch();
- };
- window.addEventListener('popstate', triggerPatch);
- }
- setupSPAWatches();
- observeOnceBannerExists();
- // Periodic update every hour to keep countdown fresh.
- setInterval(patchBanBanner, 60 * 60 * 1000);
- // Initial replacements.
- patchUsernames();
- patchFlairs();
- // Re-apply on dynamic content load.
- const observer = new MutationObserver(() => {
- patchBanBanner()
- patchUsernames();
- patchFlairs();
- });
- observer.observe(document.body, {
- childList: true,
- subtree: true,
- attributes: true,
- attributeFilter: ['class', 'data-user'],
- });
- })();
Add Comment
Please, Sign In to add comment