Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Highlight and Pin OKFAMS
- // @namespace Violentmonkey Scripts
- // @match https://boards.holotower.org/*
- // @grant none
- // @version 1.0
- // @author -
- // @description 4/25/2025, 11:31:44 PM
- // ==/UserScript==
- function checkThreads() {
- const threads = document.querySelectorAll('.thread');
- for (let thread of threads) {
- const replies = thread.querySelector('.replies');
- if (!replies) continue;
- const subject = replies.querySelector('.subject');
- if (!subject) continue;
- if (subject.textContent.trim() === '/OKFAMS/ Thread') {
- const strong = thread.querySelector('strong');
- if (!strong) continue;
- const parts = strong.textContent.split('/');
- const rPart = parts.find(part => part.includes('R'));
- if (!rPart) continue;
- const number = parseInt(rPart.replace(/\D/g, ''), 10);
- if (isNaN(number)) continue;
- const mix = thread.closest('.mix'); // Find the parent with class "mix"
- const grid = document.getElementById('Grid'); // Find the #Grid parent
- if (!mix || !grid) continue; // Safety check
- thread.style.border = '';
- if (number < 1500) {
- thread.style.border = '3px solid red';
- // Move the entire .mix to be the first child of #Grid
- if (grid.firstChild !== mix) {
- grid.insertBefore(mix, grid.firstChild);
- }
- } else {
- thread.style.border = '';
- }
- // Only handle the first matching thread
- break;
- }
- }
- }
- // Run once on page load
- window.addEventListener('load', checkThreads);
- // Run every 20 seconds
- setInterval(checkThreads, 20000);
Advertisement
Add Comment
Please, Sign In to add comment