Skip to content

Instantly share code, notes, and snippets.

@GFoley83
Created September 30, 2018 22:52
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save GFoley83/a0eabe76661f1c4d0c603292bd399a89 to your computer and use it in GitHub Desktop.
Save GFoley83/a0eabe76661f1c4d0c603292bd399a89 to your computer and use it in GitHub Desktop.
Unlike facebook, LinkedIn creates entire posts just for likes and comments which fills up the feed with crap. This snippet removes those posts from the feed. Best used with an Chrome extension like "Custom JavaScript for Websites".
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);
@amg1127
Copy link

amg1127 commented Apr 16, 2020

Thanks! I was wanting such script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment