Unlike facebook, LinkedIn creates entire posts just for likes and comments which fills up the feed with crap. This snippet removes posts from the feed that aren't proper content.
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
const removeCrap = () => { | |
const $crapSelector = $(` | |
span.ember-view span:contains(" likes this"), | |
span.ember-view span:contains(" commented on this"), | |
span.ember-view span:contains(" liked "), | |
span.ember-view span:contains("Short course you may like"), | |
div.feed-shared-text-view span:contains("Promoted") | |
`); | |
const crapCount = $crapSelector.length; | |
if(crapCount === 0){ | |
return; | |
} | |
$crapSelector | |
.closest('.relative.ember-view') | |
.remove(); | |
//.css('opacity','0.3'); // Fade out instead of remove | |
console.log(`Removed ${crapCount} LinkedIn BS posts.`); | |
}; | |
setInterval(removeCrap, 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment