Generates Daily Digest from Pocket
- Ruby >= 2.x
- Bundler >= 1.x
- Mercury Web Parser API Key
- Pocket API Key and authorized token
- Kindlegen
- ImageMagick (Build with librsvg for SVG support)
rake deliver
will run the following tasks:
- Fetch unread items from Pocket
- Parse content with Mercury
- Create table of contents and
.opf
file - Create mobi file with Kindlegen
Depending on your configuration, daily_digest
will deliver the generated MOBI file to your destination in either:
- Copy the mobi to an arbitrary folder called
DESTDIR
in your.env
file for further processing - Send the mobi file as an email attachment if SMTP server authentication is configured (see below)
You can let IFTTT watch /Kindle
subfolder to send to your Kindle personal document free email address.
(On Mac, you'll need to configure bundle
to use /usr/local/bin
with: bundle config --global system_bindir /usr/local/bin
)
bundle install
$EDITOR .env
bundle exec rake deliver
You will have .env
file that looks like:
POCKET_CONSUMER_KEY=1234-abcd
POCKET_ACCESS_TOKEN=a2aa5caa-c000-6ecb-b589-f7daea
MERCURY_API_KEY=2caeae6676796adada6967a5cddcd6a2292
CLEANUP=true
You have to manually authenticate against Pocket OAuth endpoint to get the tokens. I used Pocket-CLI but you can use curl
if you want to avoid the dependency.
If you want to directly send email to your Kindle Personal Document, you'll need the following environment variables as well:
[email protected]
[email protected]
SMTP_SERVER=smtp.example.com:587
[email protected]
SMTP_PASSWORD=43829f4cchRRY8
If you want to use Gmail to send the mail, you'll probably need an App Password which you can get from Google Security | App Passwords
Changes from original/upstream project miyagawa/daily_digest
- Removed dependency on Calibre and ImageMagick
- Added generated table of contents, cover image,
opf
"manifest" - Added note about dependency on ImageMagick (also in upstream, but not mentioned)
- Removed dependency on Readability (defunct) and switched to Mercury Web Parser
Tatsuhiko Miyagawa, Aubin Paul
This software is licensed under the MIT License.