Programmatic reading and writing practice books.
Requires a .env file with the following variables:
- NYT_API_KEY - API key from the New York Times (wordlist)
- UNSPLASH_APP_ID - Unsplash.com App ID (photos)
- UNSPLASH_SECRET - Unsplash.com API secret (photos)
- PROJECT_ID - Google Cloud project ID (translations)
- DB_URL - Mongo connection string`
Scripts are seperate in order to work around API limits.
Generate wordlist from NYT:
node bin/translations-import.js (you'll need to enable the Google Translations API in the Cloud Console)
Export data and import a CSV of sentences for each word:
- Create a directory in the project folder called "./tmp"
node bin/generate-csv.jswill export a CSV
- Add sentences to a new column called "New Sentence"
node bin/csv-import.jsto add the sentences to the database
- Create a "./pdf" directory inside "./tmp"
- Make sure all the data is seeded, then run