Skip to content
Permalink
Browse files

fix LoC SRU to use new format ( http://www.loc.gov/standards/sru/lcSe…

…rvers.html ) which seems more reliable.

Some compat updates (@simonster - you're aware tests are down again?)
  • Loading branch information...
adam3smith committed Jun 1, 2013
1 parent 991cfc6 commit 6ca4bc3aabc2c7d12fc83ea20ea3212278282001
@@ -8,8 +8,8 @@
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcv",
"lastUpdated": "2013-05-10 05:23:14"
"browserSupport": "gcbv",
"lastUpdated": "2013-05-15 20:05:47"
}

/*
@@ -8,8 +8,8 @@
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcv",
"lastUpdated": "2013-05-08 23:03:38"
"browserSupport": "gcbv",
"lastUpdated": "2013-05-15 20:05:47"
}

/*
@@ -2,14 +2,14 @@
"translatorID": "9f52911f-e1b5-41f8-be66-b16982269e6a",
"label": "HLAS (historical)",
"creator": "Sebastian Karcher",
"target": "http://lcweb2.loc.gov/cgi-bin/query",
"target": "^https?://lcweb2\\.loc\\.gov/cgi-bin/query",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsv",
"lastUpdated": "2013-04-15 18:04:37"
"lastUpdated": "2013-06-01 14:47:30"
}

/*
@@ -74,7 +74,8 @@ function scrape(doc, url){
//scrape the LC control number from the page and get LoC catalog data for it via SRU
var idnumbers = ZU.xpathText(doc, '//body/p[b[contains(text(), "LC Control No")]]');
if (idnumbers) var LCcontrol = idnumbers.match(/LC Control No\:\s*(\d+)/)[1]
ZU.doGet("http://z3950.loc.gov:7090/voyager?version=1.1&operation=searchRetrieve&query=dc.resourceIdentifier=" + LCcontrol + "&maximumRecords=1", function (text) {
Z.debug(LCcontrol)
ZU.doGet("http://lx2.loc.gov:210/LCDB?operation=searchRetrieve&version=1.1&query=bath.LCCN=" + LCcontrol + "&maximumRecords=1", function (text) {
//Z.debug(text);
var translator = Zotero.loadTranslator("import");
translator.setTranslator("edd87d07-9194-42f8-b2ad-997c4c7deefd");
@@ -8,8 +8,8 @@
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsv",
"lastUpdated": "2013-05-08 23:03:38"
"browserSupport": "gcsbv",
"lastUpdated": "2013-05-15 20:05:47"
}

/*
@@ -8,8 +8,8 @@
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcs",
"lastUpdated": "2013-04-25 14:10:42"
"browserSupport": "gcsbv",
"lastUpdated": "2013-05-15 20:05:47"
}

/*
@@ -8,8 +8,8 @@
"priority": 199,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsv",
"lastUpdated": "2013-05-10 05:23:14"
"browserSupport": "gcsbv",
"lastUpdated": "2013-05-15 20:05:47"
}

/*
@@ -25,8 +25,8 @@ 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/
ZU.doGet("http://z3950.loc.gov:7090/voyager?version=1.1&operation=searchRetrieve&query=dc.resourceIdentifier=" + ZU.cleanISBN(item.ISBN) + "&maximumRecords=1", function (text) {
//Z.debug(text);
ZU.doGet("http://lx2.loc.gov:210/LCDB?operation=searchRetrieve&version=1.1&query=bath.ISBN=" + ZU.cleanISBN(item.ISBN) + "&maximumRecords=1", function (text) {
Z.debug(text);
var translator = Zotero.loadTranslator("import");
translator.setTranslator("edd87d07-9194-42f8-b2ad-997c4c7deefd");
translator.setString(text);
@@ -8,8 +8,8 @@
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcv",
"lastUpdated": "2013-05-08 23:03:38"
"browserSupport": "gcbv",
"lastUpdated": "2013-05-15 20:05:47"
}

/**
@@ -8,8 +8,8 @@
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsib",
"lastUpdated": "2012-01-30 22:44:47"
"browserSupport": "gcsibv",
"lastUpdated": "2013-05-14 21:20:45"
}

function detectWeb(doc, url) {

0 comments on commit 6ca4bc3

Please sign in to comment.
You can’t perform that action at this time.