Quote:
Originally Posted by activedirectory
I discovered that the current availability of a book is rendered using javascript and was wondering if you could give me a hint of how to recover that information?
|
There are two main cases. If the book is already on hold for the current user then the data comes from the HTML page that shows the user's holds. Otherwise it comes from the main HTML page for the book.
The book HTML page has an inline script that assigns a structure containing data about the book to window.OverDrive.mediaItems. In the plugin the get_media_items2() in overdrive.py locates this data and parses it using the JSON decoder. get_current_book_availability() extracts the needed data and calculate_wait_weeks() combines it to produce the wait time estimate.