Skip to content

Instantly share code, notes, and snippets.

@daktak
Last active January 3, 2016 02:09
Show Gist options
  • Save daktak/8393975 to your computer and use it in GitHub Desktop.
Save daktak/8393975 to your computer and use it in GitHub Desktop.
Push a Calibre recipe to your Kindle
#!/bin/bash
DOWNLOAD_DIRECTORY="/pub/sabnzbd/books"
CALIBRE_PATH=/usr/bin
PORT="25"
SERVER="localhost"
ENCRYPTION_METHOD="NONE"
KINDLE_EMAIL="[email protected]"
FROM_EMAIL="[email protected]"
PROFILE="kindle_pw"
TODAY=`date --date="now" +%d/%m/%y`
#take recipe name as input
#find using ebook-convert --list-recipes
RECIPE="$1"
OUT_FORMAT=mobi
#pull the news site
eval ebook-convert \'$RECIPE.recipe\' \'/tmp/$RECIPE.$OUT_FORMAT\' --output-profile $PROFILE
#add the date to the title
eval ebook-meta \'/tmp/$RECIPE.$OUT_FORMAT\' -t \'/tmp/$RECIPE $TODAY\'
#email
eval calibre-smtp -r $SERVER --port $PORT -e $ENCRYPTION_METHOD -v $FROM_EMAIL $KINDLE_EMAIL 'Attached' -a \'/tmp/$RECIPE.$OUT_FORMAT\'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment