This project automates the creation of a newspaper-style PDF from your favorite Substack writer's latest post and emails it to you. It leverages substackprint.com for the layout and blastula for email delivery.
├── helpers/
│ ├── pdf_generator.R # Automates substackprint.com using chromote
│ └── email_sender.R # Sends PDF via blastula
├── output/ # (Created automatically) Stores generated PDFs
├── scripts/
│ └── daily_digest.R # Main automation script
├── config.yml # Your settings
├── setup.R # Dependency installer
└── README.md
-
Install Dependencies Run the setup script to install necessary R packages:
source("setup.R") -
Configuration Edit
config.ymlwith your favorite Substack URL and your email details. -
SMTP Credentials The script uses
SMTP_PASSWORDenvironment variable for your Gmail App Password. You can set it in your.Renvironfile:SMTP_PASSWORD="your-app-password" -
Test the Workflow Run the main script manually:
source("daily_digest.R")
To run this daily at 8:00 AM, add a line to your crontab (crontab -e):
0 8 * * * /usr/local/bin/Rscript /path/to/dailydigest/daily_digest.R >> /path/to/dailydigest/cron.log 2>&1(Note: Adjust the path to Rscript and your project directory accordingly.)
This project is containerized to run daily at 6:30 AM automatically.
docker build . -t daily-digestRun the container in the background. You need to provide your SMTP password and mount the output directory.
docker run -d \
--name my-daily-digest \
-e SMTP_PASSWORD="your_google_app_password" \
-v $(pwd)/output:/app/output \
daily-digestNote for Apple Silicon Users: You may see a warning about platform mismatch (
linux/amd64). This is expected and necessary for Google Chrome compatibility.
Check if it's running:
docker ps(Status should be Up ...)
Trigger a manual run to test immediately:
docker exec my-daily-digest Rscript /app/daily_digest.R- Your computer must be awake at 6:30 AM.
- Docker Desktop must be running.
- Layout tool: substackprint.com by raw & feral.
- Automation: Built with R,
chromote, andblastula.