{
"translatorID": "530cf18c-e80a-4e67-ae9c-9b8c08591610",
"label": "Le monde diplomatique",
"creator": "Martin Meyerhoff",
"target": "^https?://(www\\.)?monde-diplomatique\\.de",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2016-11-04 22:01:09"
}
/*
Le Monde Diplomatique (de) Translator
Copyright (C) 2011 Martin Meyerhoff
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
function detectWeb(doc, url) {
if (ZU.xpathText(doc, "//p[@class='Titel']")) {
return "newspaperArticle";
} else if (url.indexOf("/archiv-text?")>-1) {
return "multiple";
}
}
function scrape(doc, url) {
var newItem = new Zotero.Item("newspaperArticle");
newItem.title = ZU.xpathText(doc, "//p[@class='Titel']");
var unterzeile = ZU.xpathText(doc, "//p[@class='Unterzeile'][1]");
var korrespondent = ZU.xpathText(doc, "//p[@class='Korrespondent']");
//newer article seems to have always a unterzeile and korrespondent
//but some older articles have these information in one line, the unterzeile
if (!korrespondent && unterzeile) {
var parts = unterzeile.split(" von ");
if (parts.length>1) {
korrespondent = parts[1];
unterzeile = parts[0];
}
}
if (korrespondent) {
korrespondent = korrespondent.replace(/^\s*von\s+/, '');
var authors = korrespondent.split(" und ");
for (var i=0; i0) {
newItem.date = ZU.strToISO(lastlineParts[1]);
}
}
newItem.publicationTitle = "Le Monde Diplomatique (Deutsch)";
newItem.url = url;
newItem.language = "de";
newItem.attachments.push({
url: url,
title: "Snapshot",
mimeType: "text/html"
});
newItem.complete();
}
function getSearchResults(doc, checkOnly) {
var items = {};
var found = false;
var rows = ZU.xpath(doc, '//ul[@class="hits"]/li/a');
for (var i=0; i