Kindle newspaper

Daily Newspaper on E-Book Reader via Arch Linux

My friend x23b5 has an Amazon Kindle and wants to read daily newspapers each morning.

Time for a cron job on my Pogoplug to send some newspapers to this Kindle 🙂

There is a pretty cool package called calibre.
It can convert online newspapers to ebook specific files and send it via email to your eBook Reader.

Install calibre

pacman -Sy calibre

Calibre uses recipes to fetch news and convert those to ebook files like .mobi or .epub.
You can list all available recipes with the following command:

ebook-convert --list-recipes

Note: It’s a good idea to create a new email for this task because your password will be saved in plain text. Use a freemailer or create a new user on your own mailserver.
Create the following file in /usr/local/bin/calibre-cron and replace all variables and recipes with yours.
I used another usb stick (cacheStick) to save the temp files because I want to protect my arch linux stick.
To change the output format just change the file extension.

nano /usr/local/bin/calibre-cron
#!/bin/bash

TEMPPATH=/media/cacheStick/calibre/
SERVER_ADDRESS=smtp.mailserver.com
USERNAME=myusername
PASSWORD=mypassword
FROM_EMAIL=ebook@mailserver.com
TO_EMAIL=testuser@kindle.com

# Netzpolitik
ebook-convert "Netzpolitik.recipe" ${TEMPPATH}netzpolitik.mobi
calibre-smtp -a ${TEMPPATH}netzpolitik.mobi -s "Netzpolitik" -r $SERVER_ADDRESS -u $USERNAME -p $PASSWORD $FROM_EMAIL $TO_EMAIL "Netzpolitik"

# Heise
ebook-convert "Heise-online.recipe" ${TEMPPATH}heise.mobi
calibre-smtp -a ${TEMPPATH}heise.mobi -s "Heise" -r $SERVER_ADDRESS -u $USERNAME -p $PASSWORD $FROM_EMAIL $TO_EMAIL "Heise"

# Berliner Zeitung
ebook-convert "Berliner Zeitung.recipe" ${TEMPPATH}bz.mobi
calibre-smtp -a ${TEMPPATH}bz.mobi -s "Berliner Zeitung" -r $SERVER_ADDRESS -u $USERNAME -p $PASSWORD $FROM_EMAIL $TO_EMAIL "Berliner Zeitung"

Make it executable:

chmod u+x /usr/local/bin/calibre-cron

Execute it and check whether it works.

Now we have to create a cron job to execute this script each morning.
Execute this command before you edit your crontab file.

export EDITOR="/usr/bin/nano"

Edit your crontab file:

crontab -e
# daily at 5:00
0 5 * * *       /usr/local/bin/calibre-cron > /dev/null 2>&1

> /dev/null 2>&1” because I don’t need any email or log output.

Now enable cron service:

systemctl enable cronie
systemctl start cronie

Calibre is pretty memory and cpu intensive and takes pretty long! You should run it overnight otherwise your plug pc will be very slow.

How it looks like:

Kindle newspaper

3 thoughts on “Daily Newspaper on E-Book Reader via Arch Linux”

  1. Thanks for the tutorial.

    The cron part was driving me nuts, because ArchLinux doesn’t use cron by default, but pacman -Sy cronie and everything works great now.

    Cheers

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.