A small script to retrieve PacktPub's daily free ebook
- Language: Python 3.
- Status: Actively Maintained.
- Libraries: Requests, JSON.
- Primary Focus: Personal Use.
Objective
The objective 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 website and extracts the tag containing today's Free Ebook/Video title, returning it as a response.
Before the latest update, the script used to contact PacktPub's servers and request for today's Free Ebook/Video title, then the JSON response was interpreted and returned, but this method doesn't seem to work anymore.
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.
Compatibility
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.