{
"translatorID": "89592f50-6ae8-491e-8988-969002012b1b",
"label": "National Library of Belarus",
"creator": "Philipp Zumstein",
"target": "^https?://www\\.nlb\\.by/portal/page/portal/index/resources/(basicsearch|expandedsearch|anothersearch|authoritet|newdoc|top100)",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2017-01-01 15:28:10"
}
/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2014 Philipp Zumstein
This file is part of Zotero.
Zotero is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Zotero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Zotero. If not, see .
***** END LICENSE BLOCK *****
*/
function detectWeb(doc, url) {
if (url.indexOf('strutsAction=biblinfoaction.do') != -1 && getMarcNode(doc).length>0 ) {//single item
return "book";
} else if (getSearchResults(doc, true)) {
return "multiple";
}
}
//for testing in detectWeb use true for checkOnly
//for the items in doWeb use false for checkOnly
//then the items will be an object containing the href/title pairs
function getSearchResults(doc, checkOnly) {
var items = {};
var found = false;
var rows = ZU.xpath(doc, '//div[@id="search_result" or @id="expandedsearchView"]//td[contains(@class, "link")]//a' );
for (var i=0; i nodes, only textNodes
var text = ZU.trimInternal(children[i].textContent) ;
if (text.length>0) {
lines.push(text);
}
}
}
//Z.debug(lines);
//call MARC translator
var translator = Zotero.loadTranslator("import");
translator.setTranslator("a6ee60df-1ddc-4aae-bb25-45e0537be973");
translator.getTranslatorObject(function (marc) {
var record = new marc.record();
var newItem = new Zotero.Item();
record.leader = lines[0];
for (var j=1; j