gourcetools on Nostr: function hideMessages() { // Define the patterns to hide const patternsToHide = ...
function hideMessages() {
// Define the patterns to hide
const patternsToHide = ['lnurl', 'lnbc', 'chatgpt', 'web3', 'lottery', 'created', 'btc.com', 'walletofsatoshi.com'];
// Select all message boxes
const messageBoxes = document.querySelectorAll('.mbox');
// Iterate through the message boxes
messageBoxes.forEach((messageBox) => {
// Get the message text
const messageText = messageBox.innerText.toLowerCase();
// Check if the message contains any of the patterns to hide
const shouldHide = patternsToHide.some((pattern) => messageText.includes(pattern));
// Hide the message if it contains any of the patterns to hide
if (shouldHide) {
messageBox.style.display = 'none';
}
});
}
setInterval(hideMessages, 1000);
Published at
2023-02-28 22:05:00Event JSON
{
"id": "35f16d5241f6a09754d2d922f2c995dac782068edd86d91370cabd81af541eea",
"pubkey": "0000005cc4586681ad8e7f4b75436fb7904b0e34ff072bb3406ddb90226d7eab",
"created_at": 1677621900,
"kind": 1,
"tags": [],
"content": "function hideMessages() {\n // Define the patterns to hide\n const patternsToHide = ['lnurl', 'lnbc', 'chatgpt', 'web3', 'lottery', 'created', 'btc.com', 'walletofsatoshi.com'];\n\n // Select all message boxes\n const messageBoxes = document.querySelectorAll('.mbox');\n\n // Iterate through the message boxes\n messageBoxes.forEach((messageBox) =\u003e {\n // Get the message text\n const messageText = messageBox.innerText.toLowerCase();\n\n // Check if the message contains any of the patterns to hide\n const shouldHide = patternsToHide.some((pattern) =\u003e messageText.includes(pattern));\n\n // Hide the message if it contains any of the patterns to hide\n if (shouldHide) {\n messageBox.style.display = 'none';\n }\n });\n}\n\nsetInterval(hideMessages, 1000);",
"sig": "829814f0ffc02ace33f08da8a87a7a4b6467f5714defd1b168635e022d7205cbc3358387f80ea6b999d89ee2e8d7530064c0df42cff3ccf0c69fc8b5457b7bb5"
}