Build your own Readwise - Motivation and logic
Why should you pay to get an email?
If you struggle to remember the last page you read let alone the book you read last summer. Congratulations, you are human.
After I made a switch to reading non-fiction, my utmost priority was remembering what I've read and actually use it somewhere.
If you have been consumed by the productivity space you must be knowing -- Readwise.
Readwise's $5.5 (460Rs) service in a nutshell -
Syncing of all your highlights from kindle, Instapaper, iBooks etc. into a central database.
Sending you a daily review i.e. a random highlight from your database.
At $10 (800-850Rs), you can also export and organize your highlights
If you're a student like me, spending 800Rs/month on an internet service just to receive an email everyday seems absurd.
After giving it some thought, I realized that the app was simple. It just had 4 parts to it.
Storing all highlights to a central database.
I've build one using Firestore and MongoDB. You can choose an SQL database as well.Fetching a random highlight.
Some databases have a random() built-in function.
Else, you will have to resort to using a random number generator and index all the highlights accordingly. (Warning - In this approach, deletion will become a problem).
Using the Gmail API or other 3rd party services to send the highlight through email.
For using the Gmail API you will have to configure OAuth2.0 for authentication.
EmailJS is also a great option, it allows you comfortably customize your email template.
Schedule the app to run at a particular time of the day like a cron job.
Use a cron expression in your JavaScript code. Ex: Cron expression to fire the app at 10:15 am everyday -
0 15 10 ? * *
.Make your code run at an HTTP GET request. Pass that URI to an application that allows scheduled execution like cron-job.org.
Note - If you're hosting the app as a web service, it may take more than 30secs to load (establishing a connection with the database takes a while). In that case, cron-job.org will dismiss the execution.
That's it. With just these 4 steps you have your own app ready!