Skip to content

Instantly share code, notes, and snippets.

@dgieselaar
Created June 23, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgieselaar/3377aa5c2223098e8622 to your computer and use it in GitHub Desktop.
Save dgieselaar/3377aa5c2223098e8622 to your computer and use it in GitHub Desktop.
Hide videos which have under a 1000 views from a youtube channel's video list
Array.prototype.slice.call(document.querySelectorAll('.yt-lockup-meta-info > li:first-child')).forEach(function ( el ) {
var views = Number(el.textContent.match(/(\d+,?\d+)/)[0].replace(',','')),
parent;
if(views < 1000) {
parent = el.parentNode;
while(!parent.classList.contains('channels-content-item')) {
parent = parent.parentNode;
}
parent.parentNode.removeChild(parent);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment