New Castle County Library Books Due Checking Script
On this page I describe a Perl script I modified from one I found on the WWW created by a gentlemen in Texas, Yong Huang. On his page he has two different scripts, one that looked like it would work with our local library system here in Delaware, and one that was for a library system powered by a completely different back-end. Either of our scripts should be able to easily be modified to work with any library system powered by the Dynix system. Farther down this page I will go into these details, as well as a few other modifications that were done to the script for our own preferences.
Don't get worried about Perl, it is just a
computer language (I am fluent in about twenty or so), and knowledge of it is
not a requirement to make this work on your computer. What you will need to do
1) Download a copy of Perl (free at the time I write this for personal use) from ActivePerl if you are a Windows person, and install it.
(Most LINUX/UNIX systems already have Perl installed.)
2) You may need to install the Net::SMTP module for Perl if you get error messages trying to run the script. You do this by going to a system prompt and type the command "ppm install libnet".
3) Download the following file NCCPL.pl and save it with an extension of ".pl".
This script is a command line one that expects you to tell it all the necessary information to check you account on the command line. The easiest way to do this is to create a batch file like this to do the checking. The example shows a batch file that checks five separate library cards for books that are about to come due. In this example one of the modifications will be the addition of a -s parameter to the script to add a name to the e-mail's subject line so you know which card has the book about to come due (we have five family members).
If you would like this to automatically run you can either put the batch file in your startup folder so it runs every time your computer starts up, or if it is on all the time, you could create a task in the task scheduler to run the batch file at the frequency you desire. Yong's page has some detailed instructions on this.
The other addition made to the script is after each book that is coming due, it now also shows the # of times it has been renewed in case you are like us and often renew the books a few times before you return them.
Here's the part for the computer folks out there that want to modify this for their Dynix library system
- Line 33 added the -s parameter
- Line 43 added the -s parameter to the syntax output
- Line 71 is the first place, the URL needed to be modified and this is done throughout the script, just do a search and replace.
also on this line is the ts=####### which needs to be modified for your library as well
- Line 128 The original line is here as well as my initial changes and then the final one that includes the parsing for the # of times the
book has been renewed.
- Line 162 This is where I put the -s parameter into the subject line
That's all there is to it. If you have questions, I can try to answer them, though all I did was hack Yong's script to make it work for our library. Now in case anyone is wondering, I got Yong's permission to post this, and include links back to his site before I created this page. I have not met him, and have only traded a couple of e-mails, but he seems to be a very nice person to have put this up in the first place, and then allowed me to do the same with my slightly modified version.