Created
March 8, 2021 15:30
-
-
Save ajpen/d2c4862f0a34145179dffe889731e841 to your computer and use it in GitHub Desktop.
Script to curate and downloads articles to kindle.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Uncomment for debugging | |
set -xe | |
# Be sure to use absolute paths here | |
outputDir=PATH/TO/OUTPUT/DIR | |
sourcesDir=PATH/TO/RECIPES/DIR | |
today=$(date +%y-%m-%d) | |
# Set up the folders first | |
todayDir="$outputDir/$today" | |
mkdir -p $todayDir | |
# Download articles from sources | |
cd $sourcesDir | |
for i in *.recipe; do | |
[ -f "$i" ] || break | |
# Download and curate articles from source | |
ebook-convert $i "$outputDir/$i-$today.mobi" --output-profile kindle | |
# Send curated articles | |
calibre-smtp -a "$outputDir/$i-$today.mobi" -s "EMAIL SUBJECT" -r imap.gmail.com --port 465 --username YOUR-EMAIL -p YOUR-APP-PASSWORD -e SSL FROM-EMAIL KINDLE-EMAIL "EMAIL-BODY (CAN BE BLANK)" | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment