isbn2marc
In April 2007 I wrote zmarc.rb, which took an ISBN and dumped out a MARC record for it. As part of OpenFRBR I did more work on it and now it’s isbn2marc. You may have better ways of getting MARC records, possibly not involving Z39.50, perhaps also in Ruby, but this does what I need for now. Patches welcome.
# USAGE # # isbn2marc [-q] [-d marcfile] [-x xmlfile] ISBN # # -q Run quietly, don't list servers queried and don't # dump MARC to STDOUT # By default isbn2marc tells STDERR what it's doing # # -d marcfile Dump MARC record to file # # -x xmlfile Dump MARCXML record to file # EXAMPLES # # Find a MARC record for the first volume of Casanova's HISTORY OF # MY LIFE and pretty print it: # # $ isbn2marc 0801856620 # # Find a MARC record for Terry Pratchett's THIEF OF TIME and write # a binary MARC file to disk as well as pretty printing it: # # $ isbn2marc -d thief.marc 0552148407 # # Find a MARC record for the first omnibus volume of the University of # Chicago Press's edition of Anthony Powell's A DANCE TO THE MUSIC OF TIME, # but don't show the record on the screen: # # $ isbn2marc -q -d stringham.marc -x templer.xml 0226677141 # # Find MARC records for all ISBNs in a file and save them on disk: # # $ cat isbns.txt # 0439064864 # 0439064872 # 0439136350 # 0439136369 # 0439139600 # 059035342X # 0736646736 # $ isbn2marc -f isbns.txt -d harry-potter.marc # # Find a MARC record but don't display it or save it: # # $ isbn2marc -q 0195024028 # # You'd be a bit silly to run that often.