Last active
August 25, 2024 11:10
-
-
Save TasfiqulTapu/366832739d85f99c470fa09e7dfc13fd to your computer and use it in GitHub Desktop.
Find rank in itch.io game jam "/entries" tab
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
// Please, make sure it is sorted by Popularity, Most rated, least rated or Karma | |
// Paste in your game id inside the string | |
const ID = "YOUR_ITCH_GAME_ID" | |
function find_rank(id){ | |
let index = 0; | |
let quit = false; | |
// load all the games in list and find the game with matching id | |
document.querySelectorAll(".index_game_cell_widget").forEach((child, )=>{ | |
if(child.dataset.game_id==id){ | |
console.log(index) | |
quit = true; | |
} | |
index++; | |
}) | |
// Scroll to the bottom to load more games | |
const scrollingElement = (document.scrollingElement || document.body); | |
scrollingElement.scrollTop = scrollingElement.scrollHeight; | |
// Continue recursion if not found | |
if(!quit) setTimeout(()=>{find_rank(id)},100) | |
} | |
//Call the function | |
find_rank(ID) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment