Skip to content

Instantly share code, notes, and snippets.

@archy-bold
Created May 21, 2024 08:19
Show Gist options
  • Save archy-bold/1255eee91e23dc13fe9ced8f3cfaeaac to your computer and use it in GitHub Desktop.
Save archy-bold/1255eee91e23dc13fe9ced8f3cfaeaac to your computer and use it in GitHub Desktop.
Get answers array from Wordle game
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