Paper Holdings in SFX, The 10 Minute Solution
I needed to show paper copies of journal holdings in SFX windows. Clicking twice in the SFX intermediate window is ok. Showing the holdings in the menu itself is good. Showing the holdings by querying the catalogue live is even better. Setting it up in 10 minutes even more better. This is the lazy solution but I'll present it here anyway.
- III Catalogue with Journal Holdings in MARC 930 fields (or something similar)
- The ISSNs of the titles in the catalogue that have paper holdings
- A new SFX getWebSearch target service
- SFX dataloader
- A small PHP script that, *suprise suprise* does some screen scraping
Creating the PHP Script
The first thing I needed to accomplish is writing up a script that will do some Xpath style scraping of a page in our OPAC:
<?php if (!isset($_GET["i"])) exit; else $i = $_GET["i"]; $html = new DOMDocument(); @$html->loadHtmlFile("http://catalogue.library.brocku.ca/search/a?searchtype=i&searcharg=".$i."&SORT=D"); $xpath = new DOMXPath($html); $nl = $xpath->query('//*[@id="bibDisplayContentMore"]//td[@class="bibInfoData"]'); //Make it a bit pretty $f = $nl->item(0)->nodeValue; $f = str_replace(" - ","<br>",$f); $f = str_replace("V.","<br>V.",$f); echo '<div style="font-family:Courier">'.$f.'</div>'; ?>
This is only possible due to the web display of my OPAC. By parsing through some divs and classes I can reliably determine what bit of text I need. The 930 that displays the holdings can always be found underneath that box of 856 links.
The script itself doesn't need much error checking. I don't intend to link to titles I don't have paper access to, so the only thing is to stop it from doing something if it isn't given an ISSN. Once uploaded you can call it similar to this:
SFX side of things
Step 1. Create a getWebSearch Target Service. I just added one to our pre-existing catalogue target. LOCAL_CATALOGUE_INNOVATIVE_INNOPAC - getWebSearch.
Step 2. 'Add New Portfolio' for that target service that correspond to the titles that are available in paper.
For demo purposes only 5 titles. We have close to 4000 journals with paper holdings
Step 3. For those titles Add a 'General Note' that renders the results of the php script in an iframe. SFX admins at OCUL schools will notice that this is exactly how the OUR system functions.
Step Extra. By using the data load feature you can upload all of your Issns and General Notes in one go. For example a Tab delimited file with ISSN<tab>GENERAL NOTE. You'll probably have to escape the non alpha characters. Load this against the getWebSearchTarget and you don't have to touch records manually.
You'll most likely need to modify the display of your SFX menu and re-order targets to get things looking the right way.
Suit to taste. You could get more elaborate with the formatting of the PHP script I suppose. The immediate advantage is that this is drawn directly from your catalogue and after setup there is absolutely no need to do any changes in SFX. You only need to delete titles from the target service once you toss all the paper copies.