- Python script that will read a list of RSS news, package them as a MOBI/EPUB file, and then send it to your kindle via kindle mail address and Amazon's whispersync at the same time everyday.
- Fetch full articles from rss feeds instead of summaries
- Convert them into an EPUB/MOBI book
- Automatically send it to your kindle at the same time everyday
- Extremely easy to setup and use. Virtually everything is easily customisable by changing just a few environment variables. Some of the important ones are -
- Number of articles to fetch
- Time range of posted articles (For instance: only fetching articles posted in last 24hrs)
- Time at which to send the book to kindle
This is a simple Python script that will download all your RSS news, package them as an EPUB first using pandoc
, and then generate a Kindle file from that. This is a very roundabout way to do things, but it turned out to give the best results.
Then, it will sleep until specified time (adjustable) and do it all over again. The idea is to leave the script running in some server, and comfortably have your news delivered to your Kindle, at the same time, at your leisure, so you can get the news and go back to the more pressing matters of your daily life without feeling like you're compulsed to chase the cycle of Ad riddled news.
docker run -d \
--name news-sender-kindle \
--restart unless-stopped \
-e EMAIL_SMTP="SMTP_ADDRESS" \
-e EMAIL_SMTP_PORT="465" \
-e EMAIL_USER="USER" \
-e EMAIL_PASSWORD="PWD" \
-e EMAIL_FROM="USER" \
-e KINDLE_EMAIL="KINDLE_USER" \
-e UPDATE_PERIOD="24" \
-e FETCH_PERIOD="24" \
-e ITEM="30" \
-e HOUR="2" \
-e MINUTE="45" \
-e ENCRYPTION="TLS" \
-v /local/path/to/config_feed_folder:/config \
ghcr.io/gabrielconstantin02/news-sender-kindle:latest
First, Change into the cloned github repo
sudo apt install docker
sudo usermod -aG docker $USER
newgrp docker
nano ./config/news2kindle.env
If you're using Gmail, you'd need to setup Google App Password and use them for username, password
fields in the file. Also, ENCRYPTION
should be set to SSL
If you're using other service providers, then their process would vary. I have provided another ENCRYPTION
type, TLS, for services such as GMX (which is supported also in Calibre)
EMAIL_SMTP=smtp.gmail.com
EMAIL_SMTP_PORT=465
[email protected]
EMAIL_PASSWORD=password
[email protected]
[email protected]
UPDATE_PERIOD=24
FETCH_PERIOD=24
ITEM=20
HOUR=5
MINUTES=0
ENCRYPTION=SSL
mv ./config/news2kindle.env
to where you store your environment variables.
For instance, I store mine at /etc/environment.d/
nano ./config/feeds.txt
The RSS feeds are listed in a file called feeds.txt
, one per line. The modification date of feeds.txt
will be the starting date from which news are downloaded.
COPY config/ config/
docker build -t news-sender-kindle .
docker run --env-file </path/to/env/file/> news-sender-kindle
where the .env
file contains all the environment variables defined in news2kindle.py.
There are a couple custom change to the script as per your own liking. These would however require changes to the script.
It is advisable to use a text editor like vs-code. But for the purpose of this documentation the commands will be using nano
.
nano ./config/news2kindle.env
change FETCH_PERIOD=24
to set up a time range.
This will fetch all the posts from the rss feed posted within now and the last X-hours.
nano ./config/news2kindle.env
change ITEM=20
to set up a max-number of posts to fetch.
nano ./config/news2kindle.env
3.1. If you'd like to change the send time edit HOUR=5
and MINUTE=0
to your preferred time in 24hr format.
Note: Remember to rebuild the docker again.
You can contribute in many ways!
- You can test the script in your own system and add steps.
- You can report bugs and issues.
- Better yet, you can SOLVE and document the bugs you come across.
- You can help optimising the code.
This script was originally developed by model-map. Since he no longer has the repo, I published my version where I :
- fixed bugs regarding epub files sending
- added additional encryption types
- added external feed config
- bundeled everything into a docker image that can be used without local build