Created
December 11, 2018 14:06
-
-
Save jgaskins/0edaa9915c26a153fb6a2d15611a3880 to your computer and use it in GitHub Desktop.
Sort Confreaks event videos by number of views
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
[...document.querySelectorAll('.video-info')] | |
.sort((a, b) => ( | |
a.querySelector('.video-views strong').innerText|0) >= (b.querySelector('.video-views strong').textContent|0) | |
? -1 | |
: 1 | |
).map(v => v.querySelector('.video-title').innerText + ' by ' + v.querySelector('.video-presenters').innerText) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment