Wouldn't it be useful/desirable to have some way to get information for a book from a central db, similar to freedb.org does for CDs? Query the db using the ISBN number for example, and have the db send back the MARC record for that object, I've written a program to check the LOC's Z39.50 server, but that is by no means exhaustive.
They have a number of plugins for their solution. Would going to amazon for information be of any use to anyone?
that's cool and all. but I was thinking of querying the LOC, as they will have(among other things) call numbers, and search keywords. Although the data may need some massaging before it would really be useful. plus I've written a script that will read a MARC record and import it directly into the database. So all I do is get the Marc from the loc, edit it w/ a text editor, then import it w/ the script.
In a comment by Fred LaPlante in the Feature_Requests/CueCat thread, he describes a mod that he made to the new bibliography page that queries the LOC and enters the result in the new bibliograpy form so you can edit it right there then submit to the database. Fred shared it with me and I modified it for 0.4.0 although someone more familiar with MARC could probably do a better job. But this interface seems to work very well. If you are interested, I will check with Fred (or it is likely he will see this message) and see if he will make it available. It requires php yaz support.
Sure, anyone can have it if they like. I made the offer last year and a couple took me up on it then. Dont see anyway to add an attachment here, but then people would want the modified version you did anyway.
I took a look at 0.4 yesterday and noticed all the MARC support. So I will probably put your modified code in there. The complexity of moving my 0.30 database to the much better 0.4 database is a bit off-putting, so really am waiting for 0.41 to do any serious work on an upgrade of the lookup code. Also I noticed that 0.40 has support for a mapping of obiblio fields to MARC tags so will consider using that instead of my lengthy if statements.
Personaly, I dont think I would ever have entered all my books into OpenBiblio if it hadn't been for the LOC lookup. This way most of the typing is eliminated, and with a cue cat on hand it really goes quickly. Of course, there are some books you can't find on LOC so those must be manual entries.
I will send the php code (both 0.3 and 0.4) to anyone who sends an email requesting it.
I have posted Fred's work and my adaption of it to 0.4.0 at:
with Fred's permission.
Fred and Matt's work is great! I successfully used it on my OpenBiblio 0.40 running on Uniform Server 2.6 (Apache and PHP4) on WinXP.
This is an EXCELLENT enhancement to OpenBiblio. I hope this is included in the next release for future users...
I first had some problems, but Matt helped me with it. He will prob post it on his web page above. But in the meantime, if some of you try using this but get script errors and the lookup doesn't seem to be working, you need to ENABLE the yaz extension in PHP. Search for php.ini and inside you will find a section called WINDOWS EXTENSIONS. Uncomment the line ;extension=php_yaz.dll and put yaz.dll into your system path. Restart Apache and PHP and try again!
Thanks Fred and Matt!
Can anyone assist me how to configure this into Postgres 8.1 server ???
OpenBiblio's never been made to work on PostgreSQL. I don't think it would be terribly hard. But you're mostly on your own, unless you wanted to hire somebody to do it for you. If you try to get it working and have specific questions about the code, ask here.
Will this make it's way into the obiblio package? or will it remain a mod?
Dave? Are you there? :(
I've taken Fred + Matt's work, and added a few things(to the 0.4x branch only)
Ability to query a webserver for a Marc record
cmd-line script to import a Marc record
Webserver script to export your obiblio database as Marc record (searches by ISBN)
Ability to specify if you want the LoC, Dewey, or local(http, record 901)
Read type of material and collection from Marc(record 903)
Read record 538a in and append it to record 520a(Master C++, ISBN: 157169000X) uses this, I would guess so would many books that come with CDs.
If you've already installed lookup.php, then all you have to do is drop the new lookup.php in place, open it and make sure you are happy with the configuration(i.e. query z39.50 or http; LoC, Dewey, or local call numbers). marc_export.php and marc_import.php will need to be opened and told where to find database_constants.php.
I just tried to look at your work - no joy. I'm a confessed Windows person and don't have a clue how to open a .bz2 file. .tar I can handle, but this one is beyond me. But I'm anxious to see the code as the additions sound useful.
tag 538a is a new one for me. Can't find it in my Aug 2002 copy of USMARC21. Guess I need a new copy. I would have expected to find CD's to be listed as 300e, but as I am not a librarian I could sure be mistaken. In my original lookup.php for obiblio 0.3, I had a bunch of stuff added to 520 (Summary), but since 0.40 has the ability to accept
any marc tag, it seems more reasonable to leave stuff in its own place as Matt did when he made the 0.40 changes. Guess I need to learn more
about these 900 series tags. My documentation stops at 6xx. I see lots of them coming from LoC now, but I supposed they were strictly for local
Wow, things are really getting confused here!! I sent an minor update of lookup.php to Matt last week privately. Guess I should have done it
on this forum.
And A.J. Gatlin sent this one privately to Matt yesterday. Thanks A.J. For catching the error. I am sure I had LCCN working at one point, so I
must have mis-typed it later on. Sorry about that.
>Thanks for making the PHP script for OpenBiblio LOC
>lookups available on your site. It's a huge time saver
>for entering books from my library.
>I did find one problem with the LCCN lookup. When
>using the Z39.50 protocol to do an LCCN lookup, you
>need to use a value of 9 for attribute 1. I found this
>As set, the PHP script searches using a value of 4
>(Title), which always fails. To fix this, the line:
>value="@attr 1=4 ">
>should instead be:
>value="@attr 1=9 ">
>With this small change, the LCCN lookup works
So there are at least 3 versions out there. I'd like to combine them all for our mutual benifit. Is there a way to post Lookup.php on the SourceForge OpenBiblio site?? Would be better for all I think.
email@example.com on 8/10/2003
First off, take the .bz2 off the URL and you can have the tarball straight. bzip2 is a compression algorithm, usually gives better than gzip.
This is what I've been going by.
Here's the 538 Entry
From what I understand the 9XX records are reserved to be defined locally.
Hmm.. you'll also have to make a couple of other mods as a windows user, As a proof-of-concept(and because I don't know how to use php-curl yet :-) ) I just wget'ed the URL to a file and then read in that file. The upside of a straight http variant is that us RedHat users don't have to rebuild php to include yaz. :-) Which I have done and have the rh9 rpm if anybody needs it.
>First off, take the .bz2 off the URL and you can have the tarball
>straight. bzip2 is a compression algorithm, usually gives better
Matt was good enough to unpack the file and send it to me.
Much easier to use than the printed copy that I have been using :
Also it clearly shows the (R)epeatable and (N)on(R)epeatable codes that Matt added to the code - wondered what they meant :-).
I was able to find the 538 tag. Looks like it would be used to describe the content of a CD, while 300e would indicate that a CD exists - including it in summary makes sense to me.
But then I could say the same for many other tags. My choice was to keep them under their own ID in the biblio_field table.
Then if desired, the various displays could/should be modified to consolidate those fields.
Regarding your in-line comment about tag '0822', yep. I checked and thats the correct tag.
I like the idea of a flag to specify what to use for CallNmbr1,2,3 so will incorporate that into my version.
The 538 code seems a bit specialized, so think for now I will leave that to you.
But I am intrigued by the http lookup and got to think a bit more about it.
Could have used it a week ago to upgrade from 0.30 I think. Not sure I have a use for it anymore, but got to think about it.
The PHP/Apache package that I use is called PHP-Home-2 and it comes with YAZ, just have to remove a single ';' from a config file to have it available.
firstname.lastname@example.org on 8/10/2003
> Matt was good enough to unpack the file and send it to me.
Fair enough, glad you got it, I've since made some mods that use php-curl rather than shelling out to wget, but I still save it to a file, then read in from that file.
> Regarding your in-line comment about tag '0822', yep. I checked and thats the correct tag.
Man, you have no idea how long I looked at that and tried to figure out why you put a zero in front of 822, and what it had to do with anything. :-0
>I like the idea of a flag to specify what to use for CallNmbr1,2,3 so will incorporate that into my version.
The 538 code seems a bit specialized, so think for now I will leave that to you.
well I couldn't think of what else to do, most libraries I've been in don't use the Dewey # or the LoC # for fiction, and they mostly use the Dewey # for nonfiction.
> But I am intrigued by the http lookup and got to think a bit more about it.
> Could have used it a week ago to upgrade from 0.30 I think. Not sure I have a use for it anymore, but got to think about it.
Not much to it, marc_export.php will take an isbn # and check your db for it, then feed that out as plain text. I get the impression that marc files are usually binary, I've just been using plaintext and using $ for the delimiter. which get's fun sometimes, specially when trying to put price in.
>The PHP/Apache package that I use is called PHP-Home-2 and it comes with YAZ, just have to remove a single ';' from a config file to have it available.
Your PHP is cooler than mine, RH strips out a bunch of stuff they don't think people will use. php-yaz happens to be one.
Has any thought been put into doing inventory yet? I've got a zaurus and I was thinking it would be badass to get the barcode scanner for it, and use it to do inventory.
>Fair enough, glad you got it, I've since made some mods that use
>php-curl rather than shelling out to wget, but I still save it to a
>file, then read in from that file.
Seen references to that 'curl' but haven't gotten around to reading about it. Think there is a reference in the new issue of PHP|Architect.
>Man, you have no idea how long I looked at that and tried to figure
>out why you put a zero in front of 822, and what it had to do with
I never thought of it that way, but when I started to check on your note, I thought the last character should have been a 'c' rather than '2'. One of the reasons I have the processing function in order by tag is to prevent that sort of mistake by me.
>well I couldn't think of what else to do, most libraries I've been
>in don't use the Dewey # or the LoC # for fiction, and they mostly
>use the Dewey # for nonfiction.
Suspect that is universaly true for real libraries, but my use is initially for use here at home where fiction is less than 10% so it gets LoC coded too. Secondary plan is for the local town library which has a total annual budget of $4500 (including salaries) so can't afford much for code!
Well, I dont know anything about library inventory, but I am currently using lookup with a cuecat $5.00 bar code reader to scan the isbn on the covers/jackets of new books. A scan ends in a CR so a search is immediately launched. So its a matter of simply a flip of a wrist and there is the form completely filled out. Still impresses me how well it works. Would think it a simple matter to add a field to the Biblio_copy table that you set by scanning a spine barcode. With a laptop, cuecat, and a wireless LAN gateway should make a comparitively easy job of it.
email@example.com on 8/11/2003
p.s. sent an update of lookup.php to Matt today which may make it onto his web site before he is out of pocket for a bit.
> Has any thought been put into doing inventory
As in stocktaking? I'd like to see this functionality go into OpenBiblio - I would be using this functionality pretty quickly! I'll be starting to look into this soon...
I just want to give great thanks to Fred for that excellent LoC script that I downloaded from his site. It was a god send since I'm doing a project for JYLO http://jylo.org , which is a non-profit organization that was stuck in the old card-based era, so they had nothing to "export."
I will be moving the site from phpMyLibrary to OpenBiblio very soon (perhaps in a few days!). Note that the former was for testing purposes so there's no real data on the server yet! :-)
PS--> If anyone else also contributed with Fred for the lookup, my thanks go out to them as well.
PPS--> I soon look to contribute code once I get my priorities straight.
I am interested in developing postgres support for openbiblio. Is there any discussions or developments going on this?
Hans van der Weij
I'm the current maintainer of OpenBiblio. For me, it is the first time that I see a question about support for PostgreSQL. The development team is not working on this, nor is someone else as far is I know.
Is there a specific reason why you are asking?