Skip to content

Instantly share code, notes, and snippets.

@rayvoelker
rayvoelker / locCallClass.html
Created September 5, 2016 19:10
javascript class for parsing, comparing and sorting library of congress call numbers
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>locCallClass test sorting of call numbers</title>
<script type="text/javascript" src="./locCallClass.js"></script>
</head>
<body style="font-family:monospace;">
SELECT
-- put your url prefix here
'http://flyers.udayton.edu/record=' || id2reckey(record_id) || 'a' AS link,
id2reckey(record_id) || 'a' as bib_record_num,
index_entry as control_number
FROM
sierra_view.phrase_entry
WHERE
SELECT
'b' || r.record_num || 'a' as bib_record_num,
v.marc_tag,
count(*) as count
FROM
sierra_view.record_metadata as r
JOIN
sierra_view.varfield as v
SELECT
e.index_entry as barcode,
'i' || i.record_num || 'a' AS item_record_num,
i.record_num as item_num,
'b' || b.record_num || 'a' as bib_record_num,
b.record_num as bib_num,
i.creation_date_gmt as item_creation_date,
i.deletion_date_gmt as item_deletion_date,
b.creation_date_gmt as bib_creation_date,
SELECT
r.record_num as bib_num,
s.content as marc_020,
v.field_content as vol
FROM
sierra_view.record_metadata as r
-- if we want to get best_title, we can select p.best_title and uncomment below
-- JOIN
SELECT
'p' || r.record_num || 'a' as patron_record_num,
v.field_content,
b.index_entry as barcode,
n.index_entry as patron_name_norm
FROM
sierra_view.record_metadata as r
JOIN
-- get patron's with no e-mail info
-- (some of which have some odd things going on in the barcode field)
SELECT
'p' || r.record_num || 'a' AS patron,
b.index_entry as barcode,
r.creation_date_gmt as creation_date,
r.record_last_updated_gmt as record_last_updated,
r.previous_last_updated_gmt as previous_last_updated,
v.field_content as patron_email
SELECT
'p' || r.record_num || 'a' as patron_record_num
-- ,*
FROM
sierra_view.record_metadata as r
WHERE
r.record_type_code = 'p'
AND r.campus_code = ''
SELECT
e.record_id, e.index_entry, v.field_content
FROM
sierra_view.phrase_entry as e
JOIN
sierra_view.varfield as v
ON
(v.record_id = e.record_id) AND (v.varfield_type_code = 'c')

How To Sync Your Movie to the Professional Jokes By Professional Comedy Professionals (AKA RiffTrax)

Intro

This guide started off as a sort of checklist for myself to try to refine, and speed up the process. I'm sure that there are a good number of things that can be improved upon, but in my opinion, the steps below produce pretty consistently good results. Hopefully this will help