Skip to content

Instantly share code, notes, and snippets.

@zwhitchcox
Created November 26, 2016 03:40
Show Gist options
  • Select an option

  • Save zwhitchcox/fb67b2ef94fd7efaad07a99fa736afc7 to your computer and use it in GitHub Desktop.

Select an option

Save zwhitchcox/fb67b2ef94fd7efaad07a99fa736afc7 to your computer and use it in GitHub Desktop.
randomizes and filters hbonow list after 2000
var ul = document.getElementsByClassName('thumbs')[0]
var toDelete = []
for (var i = 0; i < ul.children.length; i++) {
var releaseDate = ul.children[i].getElementsByClassName('now-thumbnail')[0].getAttribute('data-releasedate')
if (+releaseDate < 2000) toDelete.push(ul.children[i])
}
toDelete.forEach(function (el) {el.parentNode.removeChild(el)})
for (var i = ul.children.length; i >= 0; i--) {
ul.appendChild(ul.children[Math.random() * i | 0]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment