Created
July 21, 2014 02:51
-
-
Save ubershmekel/566926c6519f5991379b to your computer and use it in GitHub Desktop.
Filter a youtube channel by viewcounts
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
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