A bot to send you an email daily that contains a randomly selected highlight from the books you have read
Currently, reads highlights from Kindle notebooks (CSV files) and sends email via Sendgrid. Original repository here.
This was originally Nishant Nikhil's idea.
His repository has code to post the randomly chosen highlight on Twitter every 12 hours.
Check the .env.template file
$ git clone https://github.com/icyflame/excerpts_bot.git
$ cd excerpts_bot
$ mkdir -p dir_to_lookup
$ cp .env.template .env
You can put your Kindle notebooks into /dir_to_lookup
. And see the .env
file for the environment variables that are required for this script to run.
Once these have been completed, you can run the script using:
$ python3 tweebot.py
Running the tweebot.py
script with the required environment variables will
send a single email. You can use cron to make this a periodic email.
* 10 * * * python3 /media/username/code/excerpts_bot/tweebot.py
-
Get an instance on your preferred cloud provider
- You can use the cheapest instance the provider offers
- This is only a cron that is going to run once and doesn't need any significant RAM or Hard Disk
- If you already have an app instance, you can run this together with that as well (Thanks, Docker!)
-
SSH into your instance
-
Follow the steps in
Local Setup > Setup
-
Build the docker container:
docker build . -t excerpts:latest
-
Run the docker container:
docker run --name excerpts -d excerpts:latest
By default, the script is set to run once a while. The base docker image is
alpine and alpine has the convenient /etc/periodic/daily
which runs the script
once every day at 2 am.
Code licensed under MIT
Copyright (C) 2018 Siddharth Kannan mail@siddharthkannan.in