Skip to content

Instantly share code, notes, and snippets.

@creaktive
Created February 27, 2024 16:38
Show Gist options
  • Save creaktive/e236601a396358e9339221a3062e12fe to your computer and use it in GitHub Desktop.
Save creaktive/e236601a396358e9339221a3062e12fe to your computer and use it in GitHub Desktop.
New York Times Spelling Bee cheat
# scrape the answers from the game
curl -qs 'https://www.nytimes.com/puzzles/spelling-bee' \
--compressed \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:123.0) Gecko/20100101 Firefox/123.0' \
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' \
-H 'Accept-Language: en-US,en;q=0.5' \
-H 'Accept-Encoding: gzip, deflate, br' \
-H 'Connection: keep-alive' \
-H 'Upgrade-Insecure-Requests: 1' \
-H 'Sec-Fetch-Dest: document' \
-H 'Sec-Fetch-Mode: navigate' \
-H 'Sec-Fetch-Site: cross-site' \
-H 'Pragma: no-cache' \
-H 'Cache-Control: no-cache' \
| perl -ne 'BEGIN{$/=undef}/\bwindow\.gameData\s*=\s*(\{.*?\})</s&&print$1' \
| jq -r '.today.answers[]'
# try to guess the words for the given letters based on a local word dictionary
perl -ane '$_=lc;/^[deinpuz]{4,}$/&&/n/&&print' /usr/share/dict/words | sort -u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment