A NodeJS script to add an eBook from Project Gutenburg to Slate.
A NodeJS script to add an eBook from Project Gutenburg to Slate.
The script uses one of the Project Gutenburg mirrors to retrieve an eBook’s HTML file.
eBook ID to fetch the file in the mirror’s directory structure.
For example, eBook #12345
is stored under 1/2/3/4/12345-h/12345-h.htm
HTML eBook is converted to PDF using the Microlink API
In the settings, make sure these fields are set to:
Build command: npm install
Command: npm run start
Set the schedule time to how often you want the script to run.
For example:*/5 * * * *
will run every 5 minutes0 0 8 1/1 * ? *
will run once a day at 8:00am
Create two ENV variables called:API_KEY
SLATE_ID
Go to slate.host to create/retrieve your API key and Slate ID.
.env
file in the new project folder and add:API_KEY=YOUR_SLATE_API_KEY
SLATE_ID=YOUR_SLATE_ID
npm import.js