Last active
January 16, 2019 21:43
-
-
Save rikkit/ad06f730c66c54432f088a20c624835b to your computer and use it in GitHub Desktop.
Remove unavailable tickets from RWC 2019 tickets page - run it twice
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
// 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