Created
January 25, 2021 17:06
-
-
Save imsamuka/942cfc83414eea1a357d6f2ff9315c63 to your computer and use it in GitHub Desktop.
Gives list of badges sorted by how many cards are missing in the deck
This file contains hidden or 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
| function getDiference(node){ | |
| return parseInt(node.innerText.split(" ")[2]) - parseInt(node.innerText.split(" ")[0]) | |
| } | |
| Array.from(document.getElementsByClassName("badge_progress_info")) | |
| .sort( (a, b) => getDiference(a) - getDiference(b) ) | |
| .map( a => ( getDiference(a) ) + " | " + a.parentElement.parentElement.getElementsByClassName("badge_title")[0].innerText.trim() ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment