Last active
May 19, 2021 08:15
-
-
Save eviltester/71c05ae1ea584826feac7e140f249576 to your computer and use it in GitHub Desktop.
linkedin feed trimmer
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
// find the text line in a feed item e.g. [person] commented on this | |
window.setInterval(function(){ | |
Array.from(document.querySelectorAll("div.feed-shared-text-view > span > span")).forEach(function(item){ | |
if(item.innerText.endsWith(" this") || item.innerText.endsWith(" this insightful")){ | |
// mark it for ignoring and the parent for deletion | |
item.className="IGNORE"; | |
item.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.style.display="none"; | |
item.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.className="DELETEENTRY"; | |
}});},100) | |
//find promoted posts and mark for deletion | |
window.setInterval(function(){ | |
Array.from(document.querySelectorAll(".feed-shared-actor__sub-description")).forEach(function(item){ | |
if(item.innerText.endsWith("Promoted")){ | |
// mark it for ignoring and the parent for deletion | |
item.className="IGNORE"; | |
item.parentElement.parentElement.parentElement.parentElement.parentElement.style.display="none"; | |
item.parentElement.parentElement.parentElement.parentElement.parentElement.className="DELETEENTRY"; | |
}});},150) | |
//--- | |
// delete everything we marked - this isn't really needed since they are hidden above | |
window.setInterval(function(){ | |
Array.from(document.querySelectorAll(".DELETEENTRY")).forEach(function(deleteme){ | |
deleteme.parentNode.removeChild(deleteme); | |
})},500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tend to use timings 100, 500