Last active
September 15, 2023 13:34
-
-
Save cmho/8741a7d23cdb8b92280db306caac82e4 to your computer and use it in GitHub Desktop.
Secret Numbers for Cohost
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Secret Numbers | |
// @namespace https://cohost.org/ | |
// @version 1.0 | |
// @description dark cohost show me the forbidden interaction numbers | |
// @author veryroundbird @ cohost.org | |
// @match https://cohost.org/rc/project/notifications | |
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
// @grant none | |
// ==/UserScript== | |
const updateCounts = () => { | |
const allNodes = document.querySelectorAll('section div .text-notBlack div div .flex-wrap'); | |
allNodes.forEach(function(item) { | |
if (item.childNodes[0].textContent.match("Several pages shared")) { | |
let count = item.parentNode.parentNode.nextSibling.querySelector('.flex-row .flex-row').childNodes.length; | |
item.childNodes[0].textContent = `Several (${count}) pages shared `; | |
} | |
if (item.childNodes[0].textContent.match("Several pages liked")) { | |
let count = item.parentNode.parentNode.nextSibling.querySelector('.flex-row .flex-row').childNodes.length; | |
item.childNodes[0].textContent = `Several (${count}) pages liked `; | |
} | |
if (item.childNodes[0].textContent.match("Several pages followed you")) { | |
let count = item.parentNode.parentNode.nextSibling.querySelector('.flex-row .flex-row').childNodes.length; | |
item.childNodes[0].textContent = `Several (${count}) pages followed you`; | |
} | |
}); | |
}; | |
(function() { | |
'use strict'; | |
updateCounts(); | |
setInterval(updateCounts, 5000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment