Professor Robert Goodman is a prominent child psychiatrist who is the lead author of a highly regarded book on the subject, Child and Adolescent Psychiatry. With the permission of the publisher, Wiley-Blackwell, a free PDF download was made available to the public at: http://youthinmind.info/py/yiminfo/GoodmanScott3.py
In the original application, there was a counter to record the number of downloads, which involved downloading the book programmatically. Unfortunately, in early 2019, it was reported that the Microsoft Edge browser did not work with this download. This browser did work with the traditional <a href tag and PDF file. There was a desire, however, to maintain a count of downloads. ChainZy provided a very simple way of replacing the more complicated and less reliable approach.
The public page for downloading the book, http://youthinmind.info/py/yiminfo/GoodmanScott3.py, used an HTML <a href tag to call a download and count program:
The downloadbook.py program retrieved the PDF file, stamped the download into a database table and output the file contents to the calling browser:
Unfortunately, this program no longer worked with Edge browser. Simple experimentation showed that Edge did work reliably with <a href=../../yiminfo/GoodmanScott3rdEdition2012.pdf>. This approach did not, however, allow download counting.
In the ChainZy solution, the public page (http://youthinmind.info/py/yiminfo/GoodmanScott3.py) for downloading the book uses the proven <a href approach above, combined with a JavaScript fetch (call) to ChainZy for stamping of the event:
The downloadbook.py program is no longer needed and has been archived. The UserID of course is private to the ChainZy application. To count the number of stamped downloads (n=14 at the time), it is as simple as using ChainZy receiver output with grep:
In this example, a line of JavaScript, added to a conventional <a href tag, replaces 8 lines of Python program and a database table. The ChainZy approach is applicable for average website developers, whereas the previous approach required a programmer and permission to access the database management system (DBMS). In this case, book downloads are only for the author’s interest. In a case in which downloads might involve charges or potential contention, ChainZy offers forensic strength accounting with data verifiable by multiple, disinterested parties implemented with a single line of JavaScript code.