HTTPS SSH
-*- markdown -*-

UBBot is a small python script that checks the Bielefeld University Library
(BUL) if books are due. When specified, it automatically extends books which
are due that day (if possible). It is designed to be called as a cron-job and
minimize your library fees.

The BUL system sends email reminders as well (if an email address is
configured), but these reminders are sent way too early (~ 6 days before the
due date) and the information is presented in a rather verbose fashion.

UBBot is licenced under the GPL v3+.

2011-03-14


## Contact ##

I appreciate feedback and comments:

    gsauthof@techfak.uni-bielefeld.de
    gsauthof@sdf.lonestar.org


## Config ##

Setup a config file which includes your library login name and passwort, e.g. `login`:

    [user]
    name=1234
    pw=keins

## Run ##

Help:

    $ python comm.py

Testing:

    $ python comm.py -l login

List only books which are due tody (without automatic extend):

    $ python comm.py login

## Cron Job ##

Edit your crontab via:

    $ crontab -e

And add something like:

    45 7 * * * cd $HOME/ub && python comm.py -s login

Or to protect against temp service unavailable situations:

    45 7-19 * * * cd $HOME/ub && test ! -f `date -I` && python comm.py -s login && touch `date -I`
    23 23 * * * cd $HOME/ub && rm -f `date -d yesterday -I`


## Example output ##

Example mail from the cron daemon on a due date (else the script does not
produce any output and thus no mail is sent).

    Your "cron" job on host
    cd $HOME/ub && test ! -f `date -I` && python comm.py -s login && touch `date -I`
    
    produced the following output:
    
    +---------------------------------------------------------------+
    + Today (2011-03-10) following books are due:                   +
    +---------------------------------------------------------------+
    - Aho, Alfred V., The design and analysis of computer algorithms
      (1 times extended, 0 reserved)
    
    - Aho, Alfred V., The theory of parsing, translation and compiling/1
      (1 times extended, 0 reserved)
    
    - Zobel, Justin, Writing for computer science
      (2 times extended, 1 reserved)
    
    +---------------------------------------------------------------+
    + Trying to extend media                                        +
    +---------------------------------------------------------------+
    
    -  Aho, Alfred V., The theory of parsing, translation and compiling/1 (109/0599082+06)
    
    -  Aho, Alfred V., The theory of parsing, translation and compiling/2 (109/0550980+08)
    
    
    +---------------------------------------------------------------+
    + Today (2011-03-10) following books are due:                   +
    +---------------------------------------------------------------+
    - Zobel, Justin, Writing for computer science
      (2 times extended, 1 reserved)