05 March 2010

Automatically generating bibtex from LOC LCCN records

The Library of Congress has a lot of bibliographical information on all sorts of works. Much to my surprise it doesn't provide bibtex data for their entries. However, this isn't a hard problem to fix, I wrote a two line shell script to do this called locurl2bib (Library of Congress URL to bib). Suppose you want to find the bibtex entry for something that the LOC has, here's how I would do it with locurl2bib:

1. Find the entry at the LOC database.
2. Go to the LCCN record..
3. Copy the address of the LCCN record
4. Run locurl2bib on that address from the command line (on Mac OS X: /Applications/Utilities/Terminal.app), for example enter:
locurl2bib http://lccn.loc.gov/91158031

Installation:
1. locurl2bib depends on bibutils by Chris Putnam. Place them into your exectuable path*.
2. Download locurl2bib and place it in your executable path. Since it's a shell script you can view its source by opening it in a text editor. Have fun looking up bib entries at the LOC!

*On Mac OS X you will want to place the files into /usr/local/bin, and you can open this folder by pressing CMD-SHIFT-G in Finder and typing its address.

No comments:

Post a Comment