Skip to content

Instantly share code, notes, and snippets.

@ubershmekel
Created July 21, 2014 02:51
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 ubershmekel/566926c6519f5991379b to your computer and use it in GitHub Desktop.
Save ubershmekel/566926c6519f5991379b to your computer and use it in GitHub Desktop.
Filter a youtube channel by viewcounts
var thresh = 100e6;
var lis = document.querySelectorAll('.yt-lockup-meta-info li');
for(var i = 0; i < lis.length; i++) {
var text = lis[i].textContent;
if(text.indexOf('views') == -1) {
continue;
}
if(Number(text.replace(' views','').replace(/,/g, '')) < thresh) {
//console.log('-' + text);
var li = lis[i].parentNode.parentNode.parentNode.parentNode.parentNode;
li.parentNode.removeChild(li)
} else {
//console.log('+' + text);
}
};void(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment