Skip to content

Commit

Permalink
Library of Congress ISBN: Use the new HTTPS endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
dstillman committed Aug 25, 2023
1 parent 1fcdcba commit 5187948
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Library of Congress ISBN.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
"priority": 97,
"inRepository": true,
"translatorType": 8,
"browserSupport": "gcsibv",
"lastUpdated": "2022-02-07 18:32:41"
"lastUpdated": "2023-08-25 05:06:07"
}


function detectSearch(item) {
//re-enable once
/*if (item.ISBN) {
Expand All @@ -23,15 +21,16 @@ function detectSearch(item) {


function doSearch(item) {
//Sends an SRU formatted as CQL to the library of Congress asking for marcXML back
//http://www.loc.gov/standards/sru/
// Sends an SRU formatted as CQL to the Library of Congress asking for MARCXML back
// https://www.loc.gov/standards/sru/
// https://www.loc.gov/z3950/lcserver.html

let url;
if (item.ISBN) {
url = "http://lx2.loc.gov:210/LCDB?operation=searchRetrieve&version=1.1&query=bath.ISBN=^" + ZU.cleanISBN(item.ISBN) + "&maximumRecords=1";
url = "https://lx2.loc.gov/sru/lcdb?operation=searchRetrieve&version=1.1&query=bath.ISBN=^" + ZU.cleanISBN(item.ISBN) + "&maximumRecords=1";
}
else if (item.query) {
url = "http://lx2.loc.gov:210/LCDB?operation=searchRetrieve&version=1.1&query=" + encodeURIComponent(item.query) + "&maximumRecords=50";
url = "https://lx2.loc.gov/sru/lcdb?operation=searchRetrieve&version=1.1&query=" + encodeURIComponent(item.query) + "&maximumRecords=50";
}

ZU.doGet(url, function (text) {
Expand Down

0 comments on commit 5187948

Please sign in to comment.