A small script to retrieve PacktPub's daily free ebook
- Languages: Python 3.
- Status: Actively Maintained.
- Libraries: Requests, JSON
- Primary Focus: Personal Use.
The object of this small script is exploring the Packt Publishing "Free ebook" page to download and memorize the day's ebook title.
This is usually used with Conky to show the title on my desktop.
How does it work?
This script contacts PacktPub's servers and requests for today's Free Ebook/Video title, then the JSON response is interpreted and returned.
With my conky configuration, the script is executed only once at system boot and uses a hidden file to keep the information about the book, so it won't update the ebook title if the system is not rebooted or the script executed again.
This script should be compatible with any kind of crontab, allowing for scheduled execution. Also this script should be compatible with all operating systems, as it uses only standard libraries and requests
Some final notes
This script should be executed as little as possible, so to not overload the internet connection or Packt's servers, this script is made just to have some information on my desktop, nothing else.
This means also that this script doesn't download the ebooks automatically, which for me is not an issue, since if I want a certain ebook, I'll just run my browser and log into the website to download it.