Created
June 23, 2015 14:17
-
-
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
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
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