Hi,

I am guessing there are a hundred and one ways to do this, but I'd like to 
know which are most favoured.

What I am trying to do is log in to, er, a well-known-but-unspecified local 
library in the CLUG region, and parse the list of books I have currently on 
loan.  Next, I will see which of these are due back within 3 days and send 
an email to myself to say so.  This will run as a cron job once a day (and 
no, they do not provide this as a service- in fact you only get an email if 
an item is 2 weeks overdue).

So far I have written a bash script that logs in, fetches the list 
(basically the web page with the book titles you currently have out) and 
crudely chops it up to provide an output of four lines per book (title, 
author, due date, fines due).

To log in to this particular library you need your library card number and 
a PIN.  It is sent to the server as a POST form using 
x-www-form-urlencoded, which implies it is not encrypted during 
transmission.  I am storing the library card number and PIN in a hidden 
text file in the user's home directory, with only their account having read 
privileges.  I need the PIN as plain text to send to the server, but I 
don't know enough to make it safer (assuming it needs to be).

Any suggestions for further reading or good advice welcomed.

Andy

PS I'm using curl, grep and sed so far.  Tried to fit awk in, but not at 
the moment, although there is still plenty to do.

Reply via email to