Skip to content

Instantly share code, notes, and snippets.

@makaroni4
Created November 5, 2015 23:47
Show Gist options
  • Save makaroni4/8d0d03b10f3495d7620e to your computer and use it in GitHub Desktop.
Save makaroni4/8d0d03b10f3495d7620e to your computer and use it in GitHub Desktop.
(function() {
function hideBoringArticles(nodes) {
nodes.filter("article.badge-entry-container.badge-entry-entity").each(function(i, el) {
if($(el).data("entryVotes") < 20000) {
$(el).hide();
}
})
}
var MutationObserver = window.MutationObserver;
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
var $nodes = $(mutation.addedNodes);
hideBoringArticles($nodes);
});
});
var articleList = document.querySelector(".badge-entry-collection")
var $currentArticles = $(articleList).find("article.badge-entry-container.badge-entry-entity");
hideBoringArticles($currentArticles);
observer.observe(articleList, {
childList: true
});
})();
@philipphager
Copy link

Yeah :D! Very nice man!

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