{
"translatorID": "e8fc7ebc-b63d-4eb3-a16c-91da232f7220",
"label": "Aluka",
"creator": "Philipp Zumstein",
"target": "^https?://(www\\.)aluka\\.org/(stable/|struggles/search\\?|struggles/collection/)",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2016-09-27 06:02:24"
}
/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2016 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){
var type = ZU.xpathText(doc, '//div[contains(@class, "resource-type")]//div[contains(@class, "metadata-value")]');
var itemType = typeMap[type]
if (itemType) {
return itemType
} else if (getSearchResults(doc, true)) {
return "multiple";
} else {
Z.debug("Unrecognized type: " + type);
return "report";
}
}
// Aluka types we can import
// TODO: Improve support for other Aluka item types?
// Correspondence, Circulars, Newsletters, Interviews, Pamphlets, Policy Documents, Posters, Press Releases, Reports, Testimonies, Transcripts
var typeMap = {
"Books":"book",
"Aluka Essays":"report",
"photograph":"artwork",
"Photographs":"artwork",
"Slides (Photographs)": "artwork",
"Panoramas":"artwork",
"Journals (Periodicals)":"journalArticle",
"Magazines (Periodicals)" : "magazineArticle",
"Articles":"journalArticle",
"Correspondence":"letter",
"Letters (Correspondence)" : "letter",
"Interviews":"interview",
"Reports":"report",
"Transcripts":"presentation",
"Memorandums":"report"
}
function getSearchResults(doc, checkOnly) {
var items = {};
var found = false;
var rows = ZU.xpath(doc, '//h3[@class="title"]/a');
for (var i=0; i