(\d+)<\/strong><\/td>\s*/g,"$1\x1F")
// We may be breaking the indicator here
.replace(/\s*(\d*)\s*<\/td>\s*/g,"$1\x1F")
.replace(/ | (.*?)<\/td>\s*<\/tr>\s*/g,"$1\x1E")
.replace(/\x1F(?:[^\x1F]*)$/,"\x1F")
// We have some extra 0's at the start of the leader
.replace(/^000/,"");
//Z.debug(marced);
// We've used the record delimiter to delimit fields
var fields = marced.split("\x1E");
// The preprocess function gets the translator object, if available
// This is pretty vital for fancy translators like MARC
var marc = obj["translator"];
// Make a record, only one.
var record = new marc.record();
// The first piece is the MARC leader
record.leader = fields.shift();
for (var i=0; i2){
record.addField(pieces[0].trim(),
pieces[1].trim(),
// Now we insert the subfield delimiter
pieces[2].replace(/\$([a-z]|$)/g,"\x1F$1").trim());
}
}
// returns {translator: , text: false, items: [Zotero.Item[]]}
var item = new Zotero.Item();
record.translate(item);
item.libraryCatalog = obj.domain + " Library Catalog";
item.complete();
return true;
}
/** BEGIN TEST CASES **/
var testCases = [
{
"type": "web",
"url": "https://bostonpl.bibliocommons.com/item/show/2051015075_labor",
"items": [
{
"itemType": "book",
"title": "Labor",
"creators": [
{
"firstName": "Marcia McKenna",
"lastName": "Biddle",
"creatorType": "author"
}
],
"date": "1979",
"ISBN": "9780875181677",
"abstractNote": "Brief biographies of five women prominently involved in the labor movement in the United States: Mother Jones, Mary Heaton Vorse, Frances Perkins, Addie Wyatt, and Dolores Huerta. Also includes 11 other women who have made outstanding contributions",
"callNumber": "HD6079.2.U5 B52",
"libraryCatalog": "bostonpl Library Catalog",
"numPages": "126",
"place": "Minneapolis",
"publisher": "Dillon Press",
"series": "Contributions of women",
"attachments": [],
"tags": [
"United States",
"Women",
"Women labor union members",
"Working class"
],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://bostonpl.bibliocommons.com/search?t=smart&search_category=keyword&q=labor&commit=Search",
"items": "multiple"
},
{
"type": "web",
"url": "https://nypl.bibliocommons.com/item/show/10974089052_labour",
"items": [
{
"itemType": "book",
"title": "Labour",
"creators": [
{
"firstName": "György",
"lastName": "Lukács",
"creatorType": "author"
},
{
"firstName": "György",
"lastName": "Lukács",
"creatorType": "author"
}
],
"date": "1980",
"callNumber": "JFD 87-5272",
"language": "eng",
"libraryCatalog": "nypl Library Catalog",
"numPages": "139",
"place": "London",
"publisher": "Merlin Press",
"series": "The Ontology of social being",
"seriesNumber": "3",
"attachments": [],
"tags": [
"Labor",
"Philosophy",
"Philosophy, Marxist"
],
"notes": [],
"seeAlso": []
}
]
}
]
/** END TEST CASES **/ |