cr...@gtek.biz <cr...@gtek.biz> wrote:

> I have a small book collection (~150) that I thought would be neat to
> catalog by the Library of Congress catalog numbers. I have found a LOC
> search form that will allow me to input the ISBN, and it will return
> the information I want:

[..]

> I have the list of book ISBNs in a text file, so scripting this should
> be quite easy. The problem is I can't figure out how to submit the form
> from the command line. I figured wget would be the best way, but
> everything I try results in downloading a single line that reads "Your
> form didn't include an ACTION!" So I thought I would turn to here for
> help. The test ISBN I am using is for The Linux Cookbook: 1886411484,
> QA76.76.O63S788 2001.

There are several urls on loc.gov that will retrieve book information
from an ISBN. The one below has no problem with session cookies. So
wouldn't this quick and dirty one-liner do what you want?


  #!/bin/sh
  
  # loc.sh <ISBN>
  
  elinks -dump -dump-charset utf8 -no-references -no-numbering \
  "http://www.loc.gov/cgi-bin/zclient?host=z3950.loc.gov&port=\
  7090&attrset=BIB1&rtype=USMARC&DisplayRecordSyntax=HTML&ESN=F&startrec=\
  1&maxrecords=10&dbname=Voyager&srchtype=1,7,2,3,3,1,4,1,5,1,6,1&term_term_1=\
  $1"

so loc.sh 1886411484 will output the information for the Linux Cookbook
in a pure text format.

> And a related side question. From my reading, I've learned that the
> Z39.50 protocol is used to query databases, usually library related. Is
> anyone aware of an ISBN database table that can be downloaded by the
> user, preferably in a format that can be imported into MySQL or
> PostgreSQL?

Probably, but I suppose the output is very standardized and then you can
easily convert it to csv-format or something.


Regards,

Morten


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/slrnk6gbgu.7au....@gatsby.mbjnet.dk

Reply via email to