38
Featured Item Lists for the Non- Programmer Bob Duncan Lafayette College

Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

Embed Size (px)

Citation preview

Page 1: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

Featured Item Lists for the Non-Programmer

Bob DuncanLafayette College

Page 2: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

Featured Item Lists for the Non-Programmer

…how to look like an expert without really being one…

Page 3: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

http://www.lafayette.edu/

~library/bd/iugdcAll scripts and instructions are available from the above site. Expect a redirect to a different address sometime prior to September 2008.

Page 4: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

4

NOTICE:

My PowerPoint presentations are not intended to stand alone absent my commentary and occasional witty banter: Some slides may not make sense. Some slides may be totally meaningless. Some slides won’t make sense in printed form.

Feel free to email me for clarification on any of the information herein.

Page 5: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

5

Example of script Web page output

Page 6: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

6

Example of script feed output

Page 7: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

7

Example of feed source code

Page 8: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

8

Example of feed in FeedReader

Page 9: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

9

Using III feed token to group feeds

Page 10: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

10

Using III feed token to include feed

Page 11: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

11

III feed token in source

Page 12: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

12

History

Acq.pl Yuan Yao and Xiaowen Huang – 1999 (?) III review file → items listed by subject heading

Can be nasty looking Loss of context (“Brain” far from “Neuropsychology”)

Acq.pl a la Bob III review file → Word macro → items grouped by

requesting department/program III review file → items for a location, type, etc. III review file → items listed by call number

Page 13: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

13

Current

NewAcq.pl Based on Acq.pl Perl regular expressions replace Word macros III review file → items grouped by subject

RSS feeds by subject Extensible

Easily customized No Perl knowledge required

Page 14: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

14

External script vs. III “Featured Lists” Advantages

You decide: what to present how to present it

Free up lists (use one list for multiple subjects/feeds) Retain historical lists (if desired) RSS feeds (if desired)

Disadvantages File management Need to remember to do things

Page 15: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

15

Basic Requirements

Perl “distribution” ActiveState.com – ActivePerl

Web Server to display results Non-III preferred

Separate directory for feeds III will suffice

Call numbers that indicate something Someone working in Cataloging

Page 16: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

16

Handy tools

Create Lists familiarity Email access

III review file “listed” to email Good text editor

Notepad++ Good FTP client

FileZilla Techno freedom

Page 17: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

17

Component activities

III-based activities Generate the review file List the data

Local activities Get the data Run the script

Edit once Proofread the results Serve the results

Page 18: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

18

III-based activities

Generate the review file (Lafayette specific)LINKED REC exists to ITEM

BCODE3 equal to “-”

PUBLISHER not equal to “”

TITLE At Least one Field doesn't have “electronic resource”

MARC Tag 035 All Fields don't have “ssj”

Above criteria saved as Saved Search

CAT DATE between “ - - “ and “ - - “

Range of records: ~70,000 (Lafayette specific) Sort by title

Page 19: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

19

III-based activities, cont. List the data

Call # TITLE PUBLISHER Call # RECORD #

2 blank lines between Do not number records Each field on new line Display labels No uppercase titles

Page 20: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

20

CALL # = PS3569.L695 A64 2000. TITLE = Abe : a novel / Richard Slotkin. PUBLISHER = New York : H. Holt and Co., c2000. CALL # = PS3569.L695 A64 2000. RECORD # = b17244067.

CALL # = N72.H63 G63 2007. TITLE = Abstraction and the Holocaust / Mark Godfrey. PUBLISHER = New Haven [Conn.] ; London : Yale University Press, c2007. CALL # = N72.H63 G63 2007. RECORD # = b17240657.

Script depends on this format:

If your field labels are different, the script or the input file will need to be edited!!!

At least two lines between records

is required!

Page 21: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

21

III-based activities, cont.

“Print” to email Consider diacritics issue

Script will convert III {diacritics} to HTML character entity references

No print to email? Export solution in the works

Nothing else to say on a slide? Just add a bullet point

…or two …or three

Page 22: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

22

Local activities

Customize the Perl script(s) Should be one time deal

Receive the email Save as text file

Run the Perl script Proofread the output FTP the file(s) Look like a genius

Page 23: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

23

Local activities – customize script(s) NewAcq_container.pl

Code for top / bottom of Web page List of items appears between

NewAcq_call2subject.pl Converts call numbers to subjects

Edit only if more than DDC and/or LC

NewAcq.pl The big enchilada

Library-specific variables

Page 24: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

24

Local activities – customize script(s) NewAcq_container.pl

Code for top / bottom of Web page Perl subroutines are called by the main script

Content appears in <div> element between the header code and the footer code

sub insert_header {print OUT <<EOM; HTML code for the top of your page goes hereEOM}

sub insert_footer {print OUT <<EOM; HTML code for the bottom of your page goes hereEOM}

Page 25: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

25

NewAcq_container.plsubroutine for footer

sub insert_footer {print OUT <<EOM; HTML code EOM}

Last updated $dateus

Page 26: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

26

Local activities – customize script(s) NewAcq_call2subject.pl

Converts call numbers to subjects Perl subroutines are called by the main script

Edit only if you have call numbers in addition to DDC and/or LC, e.g., “Fiction” or “Juvenile”

Basic regular expression syntax: s/ find this / replace with this /g; Literal strings and wildcards

s/\n\nCALL # = AV:.*\n/SUBJECT = Videos/g;

s/\n\nCALL # = FICTION.*\n/SUBJECT = Fiction/g;

Page 27: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

27

NewAcq_call2subject.plsubroutine for special call

numbers

Page 28: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

28

Local activities – customize script(s) NewAcq.pl

The big enchilada Library-specific variables

Basic syntax: $VariableName = “TextString” ; $VariableName = Numeral ;

Examples:$inputfile = "newacq_LC.txt" ;

$catlink = "Full Catalog Record." ;

$displaycallno = 0 ;

Page 29: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

29

NewAcq.plLibrary-specific variables

Page 30: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

30

Library-specific variables – FILES $inputfile

Path/name of text file from III $outputfile

Path/name of the Web page that will be created $pagetitle

Title of the Web page $localfeedsdir

Path to the folder on the local computer where the feed files should be created

Page 31: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

31

Library-specific variables – FEEDS $wantfeeds

Do you want to create feeds? $feedserver

Where the feeds will live $feedlinks

Do you want to see links to the feeds from the Web page?

$rssimage Path/name of image file for link to feeds

Page 32: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

32

Library-specific variables – OPAC LINKS $serverbase

Your III server URL (for links to catalog records) $catlink

Text for the links to catalog records $newwindow

Do you want the links to catalog records in a new window?

Page 33: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

33

Library-specific variables – DISPLAY $displaynavlinks

Do you want internal navigation links? $navlinksform

Format for the internal nav links to take $displaycallno

Do you want to see the call # on the Web page? $displaypub

Do you want to see the publisher on the Web page?

Page 34: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

34

Library-specific variables – CALL #s $lcc

Do you have Library of Congress call numbers? $ddc

Do you have Dewey call numbers? $ddclevel

What level of granularity for Dewey do you want? $specialcall

Do you have call numbers other than LC or DDC?

Page 35: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

35

Local activities – receive the email Mail client (Eudora, Outlook, etc.)

Save message as text Web mail

Save as above (if possible) OR Copy/paste list of records

File name = value of $inputfile variable Make sure:

No headers in text file File starts with at least two blank lines Each field starts on a new line

Page 36: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

36

Local activities – run the script Run the script

Make sure: Input file is where it should be Local directory for feeds exists

Double-click Command line

U:\acq pl>perl NewAcq.pl Turn on warning:

U:\acq pl>perl –w NewAcq.pl

Page 37: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

37

Local activities – the rest…

Proofread the output Occasional “odd” subject Adjust links to other pages?

FTP the files File management issues

More scripting?

Look like a genius The gift that keeps on giving…

Page 38: Featured Item Lists for the Non-Programmer Bob Duncan Lafayette College

Feel free to contact me with questions…

Bob Duncan

[email protected]