A simple puppeteer script to download the epub version of the latest Le Monde Diplomatique edition. For those too lazy to log into the site, download it manually and put it on their e-reader.
This script runs on my raspberry pie at home. To make the most of it, I have an extra script that I call monthly with a crontab:
!/bin/bash
echo "starting task"
cd /home/USER/scripts/epubGrabber/
sudo -u USER node epubGrabber.js
tail --pid=$pid -f /dev/null
echo "download completed"
rsync -r /home/USER/scripts/epubGrabber/downloads/ /var/www/books/
echo "job done"
This script runs the puppeteer automation and puts the latest edition of the newspaper in /var/www/books/, a directory that I’m serving on a local IP wthanks to a basic nginx configuration.
With this, I can access the file server from my Kobo’s integrated browser and get the latest edition on my e-reader without having to do anything.
