[CALUG] CALUG Digest, Vol 43, Issue 5
Smith, Joshua A. (AISD)
Joshua.A.Smith at jhuapl.edu
Fri Jul 9 12:02:49 EDT 2010
Wow, the coding nazis are out in full force
-Josh
-----Original Message-----
From: calug-bounces at unknownlamer.org [mailto:calug-bounces at unknownlamer.org] On Behalf Of calug-request at unknownlamer.org
Sent: Friday, July 09, 2010 12:00 PM
To: calug at unknownlamer.org
Subject: CALUG Digest, Vol 43, Issue 5
Send CALUG mailing list submissions to
calug at unknownlamer.org
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.unknownlamer.org/listinfo/calug
or, via email, send a message with subject or body 'help' to
calug-request at unknownlamer.org
You can reach the person managing the list at
calug-owner at unknownlamer.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of CALUG digest..."
Today's Topics:
1. Re: library script (James Ewing Cottrell 3rd)
----------------------------------------------------------------------
Message: 1
Date: Fri, 09 Jul 2010 11:05:15 -0400
From: James Ewing Cottrell 3rd <JECottrell3 at Comcast.NET>
Subject: Re: [CALUG] library script
To: "John L. Cunningham" <djohngo at gmail.com>
Cc: Columbia Area Linux User Group <calug at unknownlamer.org>
Message-ID: <4C373AAB.4070204 at Comcast.NET>
Content-Type: text/plain; charset="iso-8859-1"
Cool. It's nice that you can even DO that. However, the script is
UNREADABLE, and most importantly, the differences are buried .
Try breaking the URL up into pieces, as follows:
host=http://polaris.hclibrary.org
path=polaris/search/searchresults.aspx
arg1="ctx=1.1033.0.0.6&type=Advanced&term=$SEARCH_TERM&term2=&term3=&term4="
arg2="by2=KW&by3=KW&by4=KW&bool1=And&bool2=And&bool3=And
arg4="limit=TOM=*&sort=RELEVANCE&page=0"
case $OPTION in
(-a) arg3="by=AU";;
(-i) arg3="by=ISBN";;
(-t) arg3="by=TI";;
(*) usage;;
esac
exec firefox --new-tab "$host/$path?$arg1&$arg2&$arg3&$arg4"
Now, if you wanted to add a -d (for date: by=DA) option, well, it's so
simple, Even a Caveman Could Do It.
Please not that any source code, in any language should not exceed 80
characters in width if possible.
JIM
On 7/6/2010 3:30 PM, John L. Cunningham wrote:
> The redesigned Howard County Public Library site is too pointy-clicky
> for my taste. Therefore, I have written a rudementary bash script that
> allows me to search the catalog from the command line.
>
>
> --- BEGIN hcllookup.sh ---
> #!/bin/bash
>
> OPTION="$1"
> shift
> SEARCH_TERM="$*"
>
> case "$OPTION" in
> -a)
> firefox --new-tab "http://polaris.hclibrary.org/polaris/search/searchresults.aspx?ctx=1.1033.0.0.6&type=Advanced&term=$SEARCH_TERM&term2=&term3=&term4=&by=AU&by2=KW&by3=KW&by4=KW&bool1=And&bool2=And&bool3=And&limit=TOM=*&sort=RELEVANCE&page=0"
> ;;
> -i)
> firefox --new-tab "http://polaris.hclibrary.org/polaris/search/searchresults.aspx?ctx=1.1033.0.0.6&type=Advanced&term=$SEARCH_TERM&term2=&term3=&term4=&by=ISBN&by2=KW&by3=KW&by4=KW&bool1=And&bool2=And&bool3=And&limit=TOM=*&sort=RELEVANCE&page=0"
> ;;
> -t)
> firefox --new-tab "http://polaris.hclibrary.org/polaris/search/searchresults.aspx?ctx=1.1033.0.0.6&type=Advanced&term=$SEARCH_TERM&term2=&term3=&term4=&by=TI&by2=KW&by3=KW&by4=KW&bool1=And&bool2=And&bool3=And&limit=TOM=*&sort=RELEVANCE&page=0"
> ;;
> *)
> printf "Usage: hcllookup [OPTION] [SEARCH TERM(S)...]\n\t-a, Author\n\t-i, ISBN\n\t-t, Title\n"
> ;;
> esac
> --- END hcllookup.sh ---
>
>
> John
>
> _______________________________________________
> CALUG mailing list
> CALUG at unknownlamer.org
> http://lists.unknownlamer.org/listinfo/calug
>
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.830 / Virus Database: 271.1.1/2985 - Release Date: 07/06/10 02:36:00
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.unknownlamer.org/pipermail/calug/attachments/20100709/eb892c18/attachment.html
------------------------------
_______________________________________________
CALUG mailing list
CALUG at unknownlamer.org
http://lists.unknownlamer.org/listinfo/calug
End of CALUG Digest, Vol 43, Issue 5
************************************
More information about the CALUG
mailing list