Fetches newspaper front pages each morning and uploads them to a Meural digital frame.
-
Install prerequisites
- Node.js and npm
- ImageMagick for PDF to image conversion
-
Run the setup script
npm run setup
This installs dependencies, compiles the TypeScript sources and creates a
config.jsonfile if one doesn't exist. -
Configure credentials Update
config.jsonwith your Meural email, password, device alias and gallery name. -
Fetch and upload today's newspapers
npm start
newspapers.tsdownloads PDF front pages from the Freedom Forum and converts them into images.- Image transformation and aspect ratio enforcement are handled with ImageMagick.
- Authentication mirrors the official Meural login flow using Amazon Cognito (
@aws-sdk/client-cognito-identity-provider). - The
meural.tsclient manages gallery creation, image uploads and pushing content to your device. - Concurrency is controlled with
p-limit, and network requests are performed withaxios. - Logging output is centralized through
logger.ts.
To keep your frame up to date automatically, schedule the script with cron.
-
Open your crontab editor:
crontab -e
-
Add a job to run the script at your desired time. For example, to run every day at 6:00 AM:
0 6 * * * cd /path/to/meural-newspapers && npm start >> /var/log/meural-newspapers.log 2>&1
This navigates to the project directory and runs
npm start, appending output to a log file.Another example, running at 7:30 AM on weekdays:
30 7 * * 1-5 cd /path/to/meural-newspapers && npm start >> /var/log/meural-newspapers.log 2>&1
Enjoy seeing fresh headlines on your Meural frame every day!