RE: Recent Acquisitions List question


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Hi Mary and all,

One idea is that we could keep "new acquisitions lists" in the Innopac by using Global Update to insert local subject headings into a list of records, and then linking to it from an external source ( http://nowhere.loopback.edu/search/d?fantastic+local+subject+headings+about+new+acquisitions ) 

Has anyone tried this?

I think it's thrilling that people are interested in using PERL. I'm far from an expert, but I probably know more than people who know nothing, and can probably help you do what you want to do.

There are two related listservs where some real live experts might reside:, perl4lib (http://www.rice.edu/perl4lib/) and oss4lib (http://www.oss4lib.org/).

Since we're discussing this here (and since I'm thrilled), here goes.

Disclaimer: I don't know if any of this stuff will work, and am pretty sure none of it will work perfectly, but I hope it will help you get a sense of how to do what you're trying to do. 

Make sure you create new copies of the Acq.pl script so you can play around without mucking up your list publication process.

In this message, I'm referring to the copy of the Acq.pl script available at http://www.nellco.org/pub/acq.htm.

I think it's helpful to go through the Acq.pl script and figure out exactly what each line does. If you can at least be sure of the parts you want to change, you're ready to edit.

The first thing to think about is whether or not the modification you want to make could be done by handwriting the HTML. If it can, then PERL can write the HTML for you.

====

Joe Reimer's idea of wanting to add an automatic request feature may or may not be possible.

You could certainly have a request feature send circ. staff an email (if you have a server to run a cgi form on), but could you interface it with the WebPAC's request feature?

====

Mary Strouse's idea to have some additional fields included is definitely possible.

There's a section under the "#READING IN THE INFORMATION" comment where the fields and corressponding data are parsed. It relies on those fields being existent in every record and in this order: 

subject - title - imprint - call no - oclc

Right now, the script gets the title data by looking at the text in between 'title' and 'call no', it gets the call no data by looking at the text in between 'call no' and 'imprint', etc, and so on and so forth.

If you want to put the SERIES heading after the TITLE when applicable, a simple way to modify that clause might be to say:

first get the data between 'title' and 'series'

if that data exists, then get the data between 'series' and 'imprint'. then get on with the rest of the script.

if that data doesn't exist, get the data between 'title' and 'imprint' and then get on with the rest of the script.

The perl might look something like (or it might be a lot more concise):

if (s/.*?TITLE = (.+?)\n(?=SERIES =)//s)   ### if you've got the 'series' tag ...
     {
          (my $x = $1) =~ tr/\n/ /;
	    $ahash{$subject} = $ahash{$subject}."<br>$x\n";

     if (s/.*?SERIES = (.+?)\n(?=IMPRINT =)//s) {
           (my $x = $1) =~ tr/\n/ /;
    $ahash{$subject} = $ahash{$subject}. "<br>$x\n";
      }

      }
else   ### otherwise, do what the script said to do originally
   {
 if (s/.*?TITLE = (.+?)\n(?=IMPRINT =)//s) {
          (my $x = $1) =~ tr/\n/ /;
	    $ahash{$subject} = $ahash{$subject}."<br>$x\n";
      }
if (s/.*?IMPRINT = (.+?)\n(?=CALL # =)//s) {
          (my $x = $1) =~ tr/\n/ /;
 	    $ahash{$subject} = $ahash{$subject}. "<br>$x\n";
      }
}

# then get on with the rest of the script.

This can get very silly very fast if you have more than one optional field you want to include. It would probably be simpler if the review-file parsing bit were re-written.

====

Chuck Papirmeister's idea to include subject headings at the top of the page (http://innovativeusers.org/list/archives/2002/msg03391.html) is also very possible, and possibly very simple.

First, since each subject heading is included as a key for the data in the hash "%ahash" (say what?), you can put in a little function to output the list of keys in the hash:

while ( my ($akey, $avalue) = each (sort keys %ahash) )
  { print "<a href=\"#$akey\">$akey</a><br>"; }

You could print this list smaller list right after you print the "header" (ends in "EOM").

Next, put corresponding anchor tags around each item (so you can link to them from above). This happens in the "#INSERT INFORMATION INTO EACH ALPHABETIC GROUP" section.

====

Enjoy!

Caleb T-R
Hi Mary and all,
 
One idea is that we could keep "new acquisitions lists" in the Innopac by using Global Update to insert local subject headings into a list of records, and then linking to it from an external source ( http://nowhere.loopback.edu/search/d?fantastic+local+subject+headings+about+new+acquisitions )
 
Has anyone tried this?
 
I think it's thrilling that people are interested in using PERL. I'm far from an expert, but I probably know more than people who know nothing, and can probably help you do what you want to do.
 
There are two related listservs where some real live experts might reside:, perl4lib (http://www.rice.edu/perl4lib/) and oss4lib (http://www.oss4lib.org/).
 
Since we're discussing this here (and since I'm thrilled), here goes.
 
Disclaimer: I don't know if any of this stuff will work, and am pretty sure none of it will work perfectly, but I hope it will help you get a sense of how to do what you're trying to do.
 
Make sure you create new copies of the Acq.pl script so you can play around without mucking up your list publication process.
 
In this message, I'm referring to the copy of the Acq.pl script available at http://www.nellco.org/pub/acq.htm.
 
I think it's helpful to go through the Acq.pl script and figure out exactly what each line does. If you can at least be sure of the parts you want to change, you're ready to edit.
 
The first thing to think about is whether or not the modification you want to make could be done by handwriting the HTML. If it can, then PERL can write the HTML for you.
 
====
 
Joe Reimer's idea of wanting to add an automatic request feature may or may not be possible.
 
You could certainly have a request feature send circ. staff an email (if you have a server to run a cgi form on), but could you interface it with the WebPAC's request feature?
 
====
 
Mary Strouse's idea to have some additional fields included is definitely possible.
 
There's a section under the "#READING IN THE INFORMATION" comment where the fields and corressponding data are parsed. It relies on those fields being existent in every record and in this order:
 
subject - title - imprint - call no - oclc
 
Right now, the script gets the title data by looking at the text in between 'title' and 'call no', it gets the call no data by looking at the text in between 'call no' and 'imprint', etc, and so on and so forth.
 
If you want to put the SERIES heading after the TITLE when applicable, a simple way to modify that clause might be to say:
 
first get the data between 'title' and 'series'
 
if that data exists, then get the data between 'series' and 'imprint'. then get on with the rest of the script.
 
if that data doesn't exist, get the data between 'title' and 'imprint' and then get on with the rest of the script.
 
The perl might look something like (or it might be a lot more concise):
 
if (s/.*?TITLE = (.+?)\n(?=SERIES =)//s)   ### if you've got the 'series' tag ...
     {
          (my $x = $1) =~ tr/\n/ /;
    $ahash{$subject} = $ahash{$subject}."<br>$x\n";
     if (s/.*?SERIES = (.+?)\n(?=IMPRINT =)//s) {
           (my $x = $1) =~ tr/\n/ /;
    $ahash{$subject} = $ahash{$subject}. "<br>$x\n";
      }
      }
else   ### otherwise, do what the script said to do originally
   {
if (s/.*?TITLE = (.+?)\n(?=IMPRINT =)//s) {
          (my $x = $1) =~ tr/\n/ /;
    $ahash{$subject} = $ahash{$subject}."<br>$x\n";
      }
if (s/.*?IMPRINT = (.+?)\n(?=CALL # =)//s) {
          (my $x = $1) =~ tr/\n/ /;
    $ahash{$subject} = $ahash{$subject}. "<br>$x\n";
      }
}
 
# then get on with the rest of the script.
 
This can get very silly very fast if you have more than one optional field you want to include. It would probably be simpler if the review-file parsing bit were re-written.
 
====
 
Chuck Papirmeister's idea to include subject headings at the top of the page (http://innovativeusers.org/list/archives/2002/msg03391.html) is also very possible, and possibly very simple.
 
First, since each subject heading is included as a key for the data in the hash "%ahash" (say what?), you can put in a little function to output the list of keys in the hash:
 
while ( my ($akey, $avalue) = each (sort keys %ahash) )
  { print "<a href=\"#$akey\">$akey</a><br>"; }
 
You could print this list smaller list right after you print the "header" (ends in "EOM").
 
Next, put corresponding anchor tags around each item (so you can link to them from above). This happens in the "#INSERT INFORMATION INTO EACH ALPHABETIC GROUP" section.
 
====
 
Enjoy!
 
Caleb T-R