Created
May 21, 2024 08:19
-
-
Save archy-bold/1255eee91e23dc13fe9ced8f3cfaeaac to your computer and use it in GitHub Desktop.
Get answers array from Wordle game
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
var answers = []; | |
if (window.localStorage.getItem("gameState") === null) { | |
answers = getWordleState().states[0].data.boardState; | |
} | |
else { | |
answers = JSON.parse(window.localStorage.getItem("gameState")).boardState; | |
} | |
function getWordleState() { | |
for (var i = 0; i < window.localStorage.length; i++) { | |
var key = window.localStorage.key(i); | |
if (key.startsWith("games-state-wordleV2")) { | |
return JSON.parse(window.localStorage.getItem(key)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment