A Node.js application that scrapes and stores Wordle words from the New York Times API, starting from June 19, 2021. The script automatically updates every 24 hours to fetch the latest word.
- Fetches historical Wordle words since June 19, 2021
- Automatically updates daily to get the new word
- Stores words in a JSON file with their corresponding dates
- Shows a live countdown timer until the next word check
- Handles errors gracefully and avoids duplicate entries
- Node.js (version 12.20.0 or higher)
- npm (Node Package Manager)
- Clone this repository or download the source code
- Navigate to the project directory
- Install dependencies:
npm install
To start the scraper:
npm start
The script will:
- First fetch all historical words since June 19, 2021
- Check for today's word
- Display a countdown timer until the next check (24 hours)
- Automatically update the
wordle-words.json
file with new words
The words are stored in wordle-words.json
with the following structure:
{
"words": [
{
"date": "YYYY-MM-DD",
"solution": "WORD"
},
...
]
}
node-fetch
: For making HTTP requests to the NYT APImoment
: For date handling and formattingmoment-timezone
: For timezone support
- The script checks for new words every 24 hours (1440 minutes)
- Words are fetched from the official New York Times Wordle API
- The script maintains a persistent JSON file to store all fetched words
- Duplicate entries are automatically prevented
- Network errors are handled gracefully
- Failed requests will be retried on the next check
- The script continues running even if individual requests fail