Programmatic reading and writing practice books.
git clone
npm install
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/fetch-data.js
Import images: node bin/image-import.js
Import translations: 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.js
will export a CSV- Add sentences to a new column called "New Sentence"
- Run
node bin/csv-import.js
to add the sentences to the database
- Create a "./pdf" directory inside "./tmp"
- Make sure all the data is seeded, then run
node bin/render-pages