Skip to content

Instantly share code, notes, and snippets.

@jgaskins
Created December 11, 2018 14:06
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 jgaskins/0edaa9915c26a153fb6a2d15611a3880 to your computer and use it in GitHub Desktop.
Save jgaskins/0edaa9915c26a153fb6a2d15611a3880 to your computer and use it in GitHub Desktop.
Sort Confreaks event videos by number of views
[...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