Handy PDW TamperMonkey script...
Resource
For those of you in the know, here is a handy TamperMonkey script I made that makes viewing PDW sooo much better. It removes all posts older than 5h, removes duplicate posts too, and adding your own keywords is easily done at the top of the script. The keywords are not case sensitive. Enjoy.
// ==UserScript== // @name Block Posts by Keywords and Age // @namespace http://tampermonkey.net/ // @version 0.5 // @description Block posts based on keywords and age // @author You // @match ://patriots.win/ // @grant none // ==/UserScript==
(function() { 'use strict';
// =================== KEYWORDS ===================
const keywords = [
'Jesus',
'Hannity',
'Pence',
'God wins'
].map(keyword => keyword.toLowerCase());
// ================================================
// Create a set to keep track of processed posts
const processedPosts = new Set();
// Toggle button
let toggleButton = document.createElement('button');
toggleButton.innerHTML = 'Toggle Post Blocking';
toggleButton.onclick = () => {
toggleButton.active = !toggleButton.active;
localStorage.setItem('toggleState', toggleButton.active);
toggleButton.style.color = toggleButton.active ? 'green' : 'red';
processPosts(); // Trigger post processing when toggled
};
toggleButton.active = localStorage.getItem('toggleState') === 'true';
toggleButton.style.color = toggleButton.active ? 'green' : 'red';
toggleButton.style.position = 'fixed';
toggleButton.style.top = '1in';
toggleButton.style.right = '1in';
toggleButton.style.zIndex = '9999';
toggleButton.draggable = true;
toggleButton.ondragend = () => {
localStorage.setItem('toggleButtonPosition', JSON.stringify({
right: toggleButton.style.right,
top: toggleButton.style.top
}));
};
const savedPosition = localStorage.getItem('toggleButtonPosition');
if (savedPosition) {
const position = JSON.parse(savedPosition);
toggleButton.style.right = position.right;
toggleButton.style.top = position.top;
}
document.body.appendChild(toggleButton);
// Function to process posts
const processPosts = () => {
if (!toggleButton.active) return;
document.querySelectorAll('.post').forEach(post => {
const postId = post.getAttribute('data-id');
if (processedPosts.has(postId)) return;
processedPosts.add(postId);
// Check age
const ageElement = post.querySelector('.timeago');
if (ageElement) {
const ageText = ageElement.textContent || '';
const ageMatch = ageText.match(/(\d+) (hours?|days?) ago/);
if (ageMatch) {
const numericValue = parseInt(ageMatch[1], 10);
if (ageMatch[2].toLowerCase() === 'hour' && numericValue > 5) {
post.style.display = 'none';
return;
} else if (ageMatch[2].toLowerCase() === 'day' && numericValue > 1) {
post.style.display = 'none';
return;
}
}
}
// Check keywords
const titleElement = post.querySelector('.top .title');
if (titleElement) {
const titleText = titleElement.textContent.toLowerCase();
if (keywords.some(keyword => titleText.includes(keyword))) {
post.style.display = 'none';
}
}
});
};
// Initial run and set interval
processPosts();
setInterval(processPosts, 6000); // 6 seconds
})();
Have tested script and it finally WORKS. Just gonna sticky this to get it into /RISING so frogs can see it. Any tech comments appreciated.
I'll just be sitting over here in the corner marveling at all of y'all's smarts and pretending I know what you're talking about. Carry on autists!
Lol...Was just thinking the same thing....
Does this work on the phone? 🙈 sorry I am not very tech savvy
No, only on PC, Windows/MAC, with a browser that has TM installed.
Thanks catsfive
I Google'd it this AM, apparently you can do it with something called Kiwi browser. Not sure how that works. I'll investigate.
Thank you - but I only have a phone. I'm sure other frens will appreciate the info about Kiwi tho 🥰
Giving this a try. It deletes a lot of content on PDW but I like what you did with the toggle. I can always turn it off if I'm looking for something. Thanks for this!
I had never heard of Tamper Monkey, so I had a look https://www.tampermonkey.net/
Tampermonkey is one of the most popular browser extension with over 10 million users. It's available for Chrome, Microsoft Edge, Safari, Opera Next, and Firefox.
It allows its users to customize and enhance the functionality of your favorite web pages. Userscripts are small JavaScript programs that can be used to add new features or modify existing ones on web pages. With Tampermonkey, you can easily create, manage, and run these userscripts on any website you visit.
For example, with Tampermonkey, you could add a new button to a web page that lets you quickly share a link on social media, or to automatically fill in a form with your personal information. This is especially useful in the age of digitization, where web pages are often used as user interfaces for accessing a wide range of services and applications.
Additionally, Tampermonkey makes it easy to find and install userscripts created by other users. This means that you can quickly and easily access a vast library of customizations and enhancements for your favorite web pages, without having to spend hours writing your own code.
Whether you're a web developer looking to add new features to your site, or just a regular user looking to improve your online experience, Tampermonkey is a great tool to have in your toolkit.
Thanks Looks like we've found a new toy!
Can you program me a script so I can have a pepe next to my name too?
Not that anyone else would see, haha