Skip to content

Instantly share code, notes, and snippets.

@rikkit
Last active January 16, 2019 21:43
Show Gist options
  • Save rikkit/ad06f730c66c54432f088a20c624835b to your computer and use it in GitHub Desktop.
Save rikkit/ad06f730c66c54432f088a20c624835b to your computer and use it in GitHub Desktop.
Remove unavailable tickets from RWC 2019 tickets page - run it twice
// remove unavailable
_.values($(".priceItem"))
.filter(item => item.lastElementChild && item.lastElementChild.innerText == "Currently Unavailable")
.forEach(item => item.remove());
// remove wheelchair tickets
_.values($(".priceItem"))
.filter(item => item.firstElementChild && item.firstElementChild.innerText.indexOf("WHEELCHAIR") > -1)
.forEach(item => item.remove())
// price filter
_.values($(".priceItem"))
.filter(item => item.lastElementChild && parseInt(item.lastElementChild.innerText.replace(",", "").match(/\d+/)[0]) > 10000)
.forEach(item => item.remove())
// remove matches with no prices
_.values($(".miniTitle")).forEach(x => x.remove());
_.values($(".prices"))
.filter(x => x.children && x.children.length == 0)
.forEach(x => x.parentElement.remove());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment