forked from zotero/translators
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPeeters.js
587 lines (561 loc) · 20.2 KB
/
Peeters.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
{
"translatorID": "c216ae06-da95-4fd0-bce8-38de1f6cf17c",
"label": "Peeters",
"creator": "Timotheus Kim",
"target": "^https?://(www\\.)?poj\\.peeters-leuven\\.be/content\\.php",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2018-03-27 05:23:49"
}
/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2018 Timotheus Chang-Whae Kim, Johannes Ruscheinski, 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 <http://www.gnu.org/licenses/>.
***** END LICENSE BLOCK *****
*/
// attr()/text() v2
function attr(docOrElem,selector,attr,index){var elem=index?docOrElem.querySelectorAll(selector).item(index):docOrElem.querySelector(selector);return elem?elem.getAttribute(attr):null;}function text(docOrElem,selector,index){var elem=index?docOrElem.querySelectorAll(selector).item(index):docOrElem.querySelector(selector);return elem?elem.textContent:null;}
function detectWeb(doc, url) {
if (url.includes('url=article')) {
return "journalArticle";
} else if (url.includes('url=issue') && getSearchResults(doc, true)) {
return "multiple";
}
}
function getSearchResults(doc, checkOnly) {
var items = {};
var found = false;
var rows = doc.querySelectorAll('tr');
for (let i=0; i<rows.length; i++) {
let href = attr(rows[i], 'td a', 'href');
let title = text(rows[i], 'td', 1);
if (!href || !title) continue;
if (checkOnly) return true;
found = true;
items[href] = title;
}
return found ? items : false;
}
function doWeb(doc, url) {
if (detectWeb(doc, url) == "multiple") {
Zotero.selectItems(getSearchResults(doc, false), function (items) {
if (!items) {
return true;
}
var articles = [];
for (var i in items) {
articles.push(i);
}
ZU.processDocuments(articles, scrape);
});
} else {
scrape(doc, url);
}
}
function ALLCaps(name) {
return name === name.toUpperCase();
}
// Concatenate the values of all nodes until a BR or B tag respecting the HTML formatting
function getValue(nodes) {
var value = "";
for (let part of nodes) {
if (part.tagName=="BR" || part.tagName=="B") break;
value += ' ';
if (part.tagName) {
value += part.outerHTML;
} else {
value += part.textContent.trim();
}
}
return value;
}
function scrape(doc, url) {
var item = new Z.Item('journalArticle');
var titleNodes = ZU.xpath(doc, '//b[contains(text(), "Title:")]/following-sibling::node()');
item.title = getValue(titleNodes);
var subtitleNodes = ZU.xpath(doc, '//b[contains(text(), "Subtitle:")]/following-sibling::node()');
var subtitle = getValue(subtitleNodes);
if (subtitle) {
item.title += ': ' + subtitle;
}
// e.g. Author(s): HANDAL, Boris , WATSON, Kevin , ..., VAN DER MERWE, W.L.
// but sometimes the space before the comma is also missing
var authors = ZU.xpathText(doc, '//b[contains(text(), "Author(s):")]/following-sibling::text()[1]');
if (authors) {
authors = authors.split(',');
}
var creator;
for (let i=0; i<authors.length; i++) {
let name = authors[i];
if (ALLCaps(name)) name = ZU.capitalizeTitle(name, true);
if (i%2===0) {// last name
creator = {
creatorType: 'author',
lastName: ZU.capitalizeTitle(name, true)
};
} else {// first name
creator.firstName = name;
item.creators.push(creator);
}
}
item.publicationTitle = ZU.xpathText(doc, '//b[contains(text(), "Journal:")]/following-sibling::a[1]');
item.volume = ZU.xpathText(doc, '//b[contains(text(), "Volume:")]/following-sibling::a[1]');
item.issue = ZU.xpathText(doc, '//b[contains(text(), "Issue:")]/following-sibling::text()[1]');
item.date = ZU.xpathText(doc, '//b[contains(text(), "Date:")]/following-sibling::text()[1]');
item.pages = ZU.xpathText(doc, '//b[contains(text(), "Pages:")]/following-sibling::text()[1]');
item.DOI = ZU.xpathText(doc, '//b[contains(text(), "DOI:")]/following-sibling::text()[1]');
item.abstractNote = ZU.xpathText(doc, '//b[contains(text(), "Abstract :")]/following-sibling::text()[1]');
item.attachments.push({
url: url,
title: "Snapshot",
mimeType: "text/html"
});
item.complete();
}
/** BEGIN TEST CASES **/
var testCases = [
{
"type": "web",
"url": "http://poj.peeters-leuven.be/content.php?url=issue&journal_code=EP&issue=3&vol=24",
"items": "multiple"
},
{
"type": "web",
"url": "http://poj.peeters-leuven.be/content.php?url=article&id=3269042&journal_code=EP",
"items": [
{
"itemType": "journalArticle",
"title": "Choosing to be Changed: Revelation, Identity and the Ethics of Self-Transformation",
"creators": [
{
"creatorType": "author",
"lastName": "Mcqueen",
"firstName": " Paddy"
}
],
"date": "2017",
"DOI": "10.2143/EP.24.4.3269042",
"abstractNote": "How should one decide whether to undergo an experience that changes who one is? In her discussion of ‘transformative experiences’, L.A. Paul argues that to choose rationally when deliberating first-personally, one should base one’s decision on ‘revelation’, i.e. to discover out what the experience will be like. If this solution is taken as the sole means by which a transformative choice is made, then I argue it is problematic. This is because (i) it overlooks the role that one’s practical identity ought to play when making a major life decision; and (ii) it ignores morally relevant reasons for action. Even if we retain the revelation approach as only part of the means through which a transformative choice is made, I argue that revelation should frequently carry little weight in our decision-making. Rather than focusing on the subjective quality of future experiences, it is often preferable to reflect on who one is and what one’s endorsed practical identity commits one to.",
"issue": "4",
"libraryCatalog": "Peeters",
"pages": "545-568",
"publicationTitle": "Ethical Perspectives",
"shortTitle": "Choosing to be Changed",
"volume": "24",
"attachments": [
{
"title": "Snapshot",
"mimeType": "text/html"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://poj.peeters-leuven.be/content.php?url=article.php&id=3269043&journal_code=EP",
"items": [
{
"itemType": "journalArticle",
"title": "Recognizing and Emulating Exemplars",
"creators": [
{
"creatorType": "author",
"lastName": "Compaijen",
"firstName": " Rob"
}
],
"date": "2017",
"DOI": "10.2143/EP.24.4.3269043",
"abstractNote": "In the present contribution I explore what is involved in recognizing and emulating exemplars, and I do so by critically engaging with the view – recently forwarded by Linda T. Zagzebski – that admiration is the key to understanding these issues. While I believe that recognizing exemplars typically involves admiration, I do not think it is sufficient. Instead, I suggest, understanding what is involved in the recognition and emulation of exemplars requires a richer account. I develop my argument in three steps. First, I engage with Zagzebski’s exemplarist moral theory and elaborate her understanding of the relationship between admiration and exemplarity on the basis of her recent work on the topic. Second, I argue why I believe that we cannot understand the recognition and emulation of exemplars by reference to admiration alone. Third, I elaborate my own account of what is involved in recognizing and emulating exemplars, which involves self-awareness, the possibility of identifying with the exemplar, and what I call ‘motivational continuity’.",
"issue": "4",
"libraryCatalog": "Peeters",
"pages": "569-593",
"publicationTitle": "Ethical Perspectives",
"volume": "24",
"attachments": [
{
"title": "Snapshot",
"mimeType": "text/html"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://poj.peeters-leuven.be/content.php?url=article.php&id=3269044&journal_code=EP",
"items": [
{
"itemType": "journalArticle",
"title": "Cognitivist Prescriptivism",
"creators": [
{
"creatorType": "author",
"lastName": "Alwood",
"firstName": " Andrew H."
}
],
"date": "2017",
"DOI": "10.2143/EP.24.4.3269044",
"abstractNote": "Metaethical cognitivism allegedly has trouble explaining how moral judgments are practical, because it claims that moral thoughts are beliefs that need not involve motivation. But motivation is not necessary to meet the practicality criterion on theories of moral thought and talk. A cognitivist about moral thought can adopt a prescriptivist account of moral talk, in a hybrid theory that supplements descriptive moral meanings in order to achieve interesting advantages over traditional descriptivist and expressivist theories as well as over other hybrid theories. This hybrid cognitivist-prescriptivist theory makes sense of amoralists who have moral judgments but no motivation, and offers a new diagnosis of why their use of moral language is infelicitous.",
"issue": "4",
"libraryCatalog": "Peeters",
"pages": "595-623",
"publicationTitle": "Ethical Perspectives",
"volume": "24",
"attachments": [
{
"title": "Snapshot",
"mimeType": "text/html"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://poj.peeters-leuven.be/content.php?url=article&id=3127266&journal_code=EP",
"items": [
{
"itemType": "journalArticle",
"title": "'Thank God I Failed': How Much Does a Failed Murder Attempt Transform the Agent?",
"creators": [
{
"creatorType": "author",
"lastName": "Cowley",
"firstName": " Christopher"
}
],
"date": "2015",
"DOI": "10.2143/EP.22.4.3127266",
"abstractNote": "Peter Winch writes: 'One who fails in his attempt to commit a murder and who undergoes a change of heart might subsequently come to thank God that he failed. It is pertinent for us to ask what precisely he has to thank God for' (1971, 144). The first answer to this question is that the thwarted attempter is relieved not to have become a murderer. In exploring the nature of this becoming, I consider and reject a ‘subjectivist’ account, according to which the attempter has already ‘become’ a murderer in virtue of his or her sincerely murderous intentions and plans. And yet clearly the attempter has lost something of the innocence that would make murder morally unthinkable. He or she thereby inhabits a curious kind of metaphysical limbo between innocence and guilt, between transformation and self-discovery, between ignorance and knowledge.",
"issue": "4",
"libraryCatalog": "Peeters",
"pages": "523-545",
"publicationTitle": "Ethical Perspectives",
"shortTitle": "'Thank God I Failed'",
"volume": "22",
"attachments": [
{
"title": "Snapshot",
"mimeType": "text/html"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://poj.peeters-leuven.be/content.php?url=issue&journal_code=EP&issue=1&vol=1",
"items": "multiple"
},
{
"type": "web",
"url": "http://poj.peeters-leuven.be/content.php?url=article&id=630100&journal_code=EP",
"items": [
{
"itemType": "journalArticle",
"title": "An Ethical Agenda for Europe: Fundamental Problems on Practical Ethics in a Christian Perspective",
"creators": [
{
"creatorType": "author",
"lastName": "Verstraeten",
"firstName": " Johan"
}
],
"date": "March 1994",
"DOI": "10.2143/EP.1.1.630100",
"abstractNote": "Today, applied ethics confronts many problems: technological and biomedical innovations, crisis of the welfare state, rising unemployment, migration and xenophobia. These and the changes accompanying them are, in themselves, important objects of study.",
"issue": "1",
"libraryCatalog": "Peeters",
"pages": "3-12",
"publicationTitle": "Ethical Perspectives",
"shortTitle": "An Ethical Agenda for Europe",
"volume": "1",
"attachments": [
{
"title": "Snapshot",
"mimeType": "text/html"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://poj.peeters-leuven.be/content.php?url=issue&journal_code=LV&issue=1&vol=73",
"items": "multiple"
},
{
"type": "web",
"url": "http://poj.peeters-leuven.be/content.php?url=article&id=3281475&journal_code=LV",
"items": [
{
"itemType": "journalArticle",
"title": "De Medellín à nos jours: Quelle place pour la catéchèse en Amérique latine?",
"creators": [
{
"creatorType": "author",
"lastName": "Jiménez Rodríguez",
"firstName": " Manuel José"
}
],
"date": "2018",
"DOI": "10.2143/LV.73.1.3281475",
"abstractNote": "currently not available",
"issue": "1",
"libraryCatalog": "Peeters",
"pages": "33-41",
"publicationTitle": "Lumen Vitae",
"shortTitle": "De Medellín à nos jours",
"volume": "73",
"attachments": [
{
"title": "Snapshot",
"mimeType": "text/html"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://poj.peeters-leuven.be/content.php?url=article&id=3251316&journal_code=LV",
"items": [
{
"itemType": "journalArticle",
"title": "Laisser la Parole de Dieu faire son travail: Un défi pour le lecteur des Écritures",
"creators": [
{
"creatorType": "author",
"lastName": "Raimbault",
"firstName": " Christophe"
}
],
"date": "2017",
"DOI": "10.2143/LV.72.4.3251316",
"abstractNote": "Trop souvent, on parle indistinctement de Bible et de Parole de Dieu. Or, la Bible n’est pas spontanément Parole de Dieu: elle le devient. L’enjeu est important. Dieu se révèle comme Parole incarnée, comme Parole adressée, comme une Bonne Nouvelle qui nous concerne et nous implique. Mais hélas certains textes bibliques ne nous parlent pas. Ils sont trop difficiles, ou trop violents, ou trop rabâchés pour être relus, ou pas lus du tout… Et pourtant, ils font partie de la Bible, dont l’inerrance et la canonicité sont incontestables. Nous trouverons ici quelques pistes pour que, de ces textes, émerge une Parole quand même. En tout état de cause, quel que soit le passage biblique lu et étudié, le lecteur qui s’astreint à une lecture attentive et à un travail sur le texte est assuré que Dieu ne restera pas sans lui parler.",
"issue": "4",
"libraryCatalog": "Peeters",
"pages": "371-382",
"publicationTitle": "Lumen Vitae",
"shortTitle": "Laisser la Parole de Dieu faire son travail",
"volume": "72",
"attachments": [
{
"title": "Snapshot",
"mimeType": "text/html"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://poj.peeters-leuven.be/content.php?url=article&id=3281483&journal_code=LV",
"items": [
{
"itemType": "journalArticle",
"title": "Mission et œcuménisme: de la concurrence à la collaboration?: 9e Forum bilingue «Fribourg Église dans le monde», Université de Fribourg, les 12-13 octobre 2017",
"creators": [
{
"creatorType": "author",
"lastName": "Amherdt",
"firstName": " François-Xavier"
}
],
"date": "2018",
"DOI": "10.2143/LV.73.1.3281483",
"abstractNote": "currently not available",
"issue": "1",
"libraryCatalog": "Peeters",
"pages": "109-113",
"publicationTitle": "Lumen Vitae",
"shortTitle": "Mission et œcuménisme",
"volume": "73",
"attachments": [
{
"title": "Snapshot",
"mimeType": "text/html"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://poj.peeters-leuven.be/content.php?url=article&id=3248537&journal_code=EP",
"items": [
{
"itemType": "journalArticle",
"title": "HREC Members' Personal Values Influence Decision Making in Contentious Cases",
"creators": [
{
"creatorType": "author",
"lastName": "Handal",
"firstName": " Boris "
},
{
"creatorType": "author",
"lastName": "Watson",
"firstName": " Kevin "
},
{
"creatorType": "author",
"lastName": "Brewer",
"firstName": " Keagan"
},
{
"creatorType": "author",
"lastName": "Fellman",
"firstName": " Marc "
},
{
"creatorType": "author",
"lastName": "Maher",
"firstName": " Marguerite "
},
{
"creatorType": "author",
"lastName": "Ianiello",
"firstName": " Hannah "
},
{
"creatorType": "author",
"lastName": "White",
"firstName": " Miya"
}
],
"date": "2017",
"DOI": "10.2143/EP.24.3.3248537",
"abstractNote": "This article identifies 14 contentious issues faced by Human Research Ethics Committees (HRECs). The authors argue that HREC members will respond variably to these issues based on their own fundamental values and worldview. In particular, we propose that personal interpretations of current ethics regulations and HREC members’ attitudes to consequentialism, Kantianism, and utilitarianism in some cases affect their responses to contentious research issues. We seek to promote understanding of how personal and professional backgrounds of HREC reviewers influence their approaches to value-laden issues embedded in ethics applications. Taking the form of a literature review, our contribution highlights the need for further exploration of how HREC members make decisions, and what factors influence the outcomes of ethics applications.",
"issue": "3",
"libraryCatalog": "Peeters",
"pages": "405-439",
"publicationTitle": "Ethical Perspectives",
"volume": "24",
"attachments": [
{
"title": "Snapshot",
"mimeType": "text/html"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://poj.peeters-leuven.be/content.php?url=issue&journal_code=EP&issue=3&vol=24",
"items": "multiple"
},
{
"type": "web",
"url": "http://poj.peeters-leuven.be/content.php?url=article&id=563038&journal_code=EP",
"items": [
{
"itemType": "journalArticle",
"title": "Philosophy and the Multi-Cultural Context of (Post)Apartheid South Africa",
"creators": [
{
"creatorType": "author",
"lastName": "Van Der Merwe",
"firstName": "W.l."
}
],
"date": "July 1996",
"DOI": "10.2143/EP.3.2.563038",
"issue": "2",
"libraryCatalog": "Peeters",
"pages": "76-90",
"publicationTitle": "Ethical Perspectives",
"volume": "3",
"attachments": [
{
"title": "Snapshot",
"mimeType": "text/html"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://poj.peeters-leuven.be/content.php?url=article&id=3256900&journal_code=BYZ",
"items": [
{
"itemType": "journalArticle",
"title": "The Unedited <i>Life</i> of St John Chrysostom by Nicetas David the Paphlagonian: <i>Editio princeps</i> , Part I",
"creators": [
{
"creatorType": "author",
"lastName": "Antonopoulou",
"firstName": " Theodora"
}
],
"date": "2017",
"DOI": "10.2143/BYZ.87.0.3256900",
"abstractNote": "The paper presents the first ever edition of the first half (chapters 1-28) of the long",
"libraryCatalog": "Peeters",
"pages": "1-67",
"publicationTitle": "Byzantion",
"shortTitle": "The Unedited <i>Life</i> of St John Chrysostom by Nicetas David the Paphlagonian",
"volume": "87",
"attachments": [
{
"title": "Snapshot",
"mimeType": "text/html"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
}
]
/** END TEST CASES **/