{
"translatorID": "b51ac026-ed35-4c68-89bb-b42b1e1ce8f2",
"label": "MCV",
"creator": "czar and Abe Jellinek",
"target": "^https?://(www\\.)?mcvuk\\.com",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2021-06-12 00:34:16"
}
/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2018-2021 czar (http://en.wikipedia.org/wiki/User_talk:Czar)
and Abe Jellinek
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 (doc.querySelector('meta[name="description"]')) {
return "magazineArticle";
} else if (getSearchResults(doc, true)) {
return "multiple";
}
}
function scrape(doc, url) {
let item = new Zotero.Item('magazineArticle');
let json = JSON.parse(text(doc, '.tie-schema-graph'));
item.title = decodeEntities(json.headline, doc);
item.publicationTitle = "MCV";
item.ISSN = "1469-4832";
item.date = json.dateModified || json.datePublished;
item.url = json.url;
item.abstractNote = decodeEntities(json.description, doc);
item.language = 'en';
for (let tag of json.keywords.split(',')) {
if (tag.toLowerCase().startsWith('mcv')) continue;
item.tags.push({ tag });
}
item.creators.push(ZU.cleanAuthor(json.author.name, 'author'));
if (["Staff", "Editors"].includes(item.creators[0].lastName)) {
delete item.creators[0].firstName; // remove the firstName param
item.creators[0].lastName = "MCV Editors"; // write the desired name to lastName
item.creators[0].fieldMode = 1; // change to single-field mode
}
item.attachments.push({ document: doc, title: 'Snapshot' });
item.complete();
}
function getSearchResults(doc, checkOnly) {
var items = {};
var found = false;
var rows = doc.querySelectorAll('.post-box-title');
var links = doc.querySelectorAll('.post-box-title a');
for (let i=0; i