{ "translatorID": "e46830a2-1b19-4b6b-9f1a-e5e9760a0f80", "label": "DigiZeitschriften", "creator": "Philipp Zumstein", "target": "^https?://www\\.digizeitschriften\\.de/((en/)?dms/|index\\.php\\?id=27[24])", "minVersion": "3.0", "maxVersion": "", "priority": 100, "inRepository": true, "translatorType": 4, "browserSupport": "gcsv", "lastUpdated": "2014-05-08 23:06:53" } /* ***** BEGIN LICENSE BLOCK ***** DigiZeitschriften Translator, 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("/img/") != -1 || url.indexOf("index.php?id=274") != -1 ) {//e.g. http://www.digizeitschriften.de/index.php?id=274&PPN=PPN342672002_0020&DMDID=dmdlog84&L=2 return "journalArticle"; } else if ( (url.indexOf("/toc/") != -1 || url.indexOf("index.php?id=272")) && getSearchResults(doc).length>0) { return "multiple"; } } function getSearchResults(doc) { return ZU.xpath(doc, '//span[contains(@class, "sitetitle") and ./parent::a/following-sibling::div]'); } function doWeb(doc, url) { var articles = new Array(); if (detectWeb(doc, url) == "multiple") { var items = {}; var titles = getSearchResults(doc); for (var i=0; i\\s*\\s*"+fieldName+":?\\s*\\s*\\s*([^<]*)"); var extraction = text.match(expression); if (extraction) { return extraction[1]; } else { return false; } } function scrape(doc, url) { var metadataUrl = ZU.xpath(doc, '//ul[@id="submenu"]/li[2]/a')[0].href.replace("/en/", "/"); var item = new Zotero.Item("journalArticle"); ZU.doGet(metadataUrl, function(text) { var structure = {}; var type; var posBefore = text.indexOf('