forked from zotero/translators
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Cambridge Core.js
360 lines (343 loc) · 15.8 KB
/
Cambridge Core.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
{
"translatorID": "850f4c5f-71fb-4669-b7da-7fb7a95500ef",
"label": "Cambridge Core",
"creator": "Sebastian Karcher",
"target": "^https?://www\\.cambridge\\.org/core/(search\\?|journals/)",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2022-02-18 16:00:30"
}
/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2016 Sebastian Karcher
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 *****
*/
function detectWeb(doc, url) {
if (url.includes('/article/')) {
return "journalArticle"; // we'll want to add book chapter and books eventually using /books/
}
else if (getSearchResults(doc, true)) {
return "multiple";
}
return false;
}
function getSearchResults(doc, checkOnly) {
var items = {};
var found = false;
var rows = ZU.xpath(doc, '//li[@class="title"]//a[contains(@href, "/article/") or contains(@href, "/product/")]');
for (var i = 0; i < rows.length; i++) {
var href = rows[i].href;
var title = ZU.trimInternal(rows[i].textContent);
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;
}
var articles = [];
for (let i in items) {
articles.push(i);
}
ZU.processDocuments(articles, scrape);
});
}
else {
scrape(doc, url);
}
}
function addOpenAccessTag (doc, item) {
let tagEntry = ZU.xpathText(doc, '//span[@class="open-access"]');
if (tagEntry && tagEntry.match(/Open Access/i)) {
item.notes.push('LF:');
}
}
function scrape(doc, url) {
var translator = Zotero.loadTranslator('web');
// Embedded Metadata
translator.setTranslator('951c027d-74ac-47d4-a107-9c3069ab7b48');
translator.setHandler('itemDone', function (obj, item) {
item.url = url;
var abstract = ZU.xpathText(doc, '//div[@class="abstract"]');
if (abstract) {
item.abstractNote = abstract;
}
var abstractImage = ZU.xpath(doc, '//div[@class="abstract-image-replacement"]');
if (abstractImage && abstractImage.length || item.abstractNote.includes('/static.cambridge.org')) {
// clear the abstract field, since it will contain a URL
item.abstractNote = "";
}
if (item.abstractNote.match(/resource\/name\/.+\.jpg$/) != null) item.abstractNote = "";
item.title = ZU.unescapeHTML(item.title);
item.libraryCatalog = "Cambridge Core";
addOpenAccessTag(doc, item);
item.complete();
});
translator.getTranslatorObject(function (trans) {
trans.itemType = "journalArticle";
trans.doWeb(doc, url);
});
}
/** BEGIN TEST CASES **/
var testCases = [
{
"type": "web",
"url": "https://www.cambridge.org/core/journals/journal-of-american-studies/article/abs/samo-as-an-escape-clause-jean-michel-basquiats-engagement-with-a-commodified-american-africanism/1E4368D610A957B84F6DA3A58B8BF164",
"items": [
{
"itemType": "journalArticle",
"title": "“SAMO© as an Escape Clause”: Jean-Michel Basquiat's Engagement with a Commodified American Africanism",
"creators": [
{
"firstName": "Laurie A.",
"lastName": "Rodrigues",
"creatorType": "author"
}
],
"date": "2011/05",
"DOI": "10.1017/S0021875810001738",
"ISSN": "1469-5154, 0021-8758",
"abstractNote": "Heir to the racist configuration of the American art exchange and the delimiting appraisals of blackness in the American mainstream media, Jean-Michel Basquiat appeared on the late 1970s New York City street art scene – then he called himself “SAMO.” Not long thereafter, Basquiat grew into one of the most influential artists of an international movement that began around 1980, marked by a return to figurative painting. Given its rough, seemingly untrained and extreme, conceptual nature, Basquiat's high-art oeuvre might not look so sophisticated to the uninformed viewer. However, Basquiat's work reveals a powerful poetic and visual gift, “heady enough to confound academics and hip enough to capture the attention span of the hip hop nation,” as Greg Tate has remarked. As noted by Richard Marshall, Basquiat's aesthetic strength actually comes from his striving “to achieve a balance between the visual and intellectual attributes” of his artwork. Like Marshall, Tate, and others, I will connect with Basquiat's unique, self-reflexively experimental visual practices of signifying and examine anew Basquiat's active contribution to his self-alienation, as Hebdige has called it. Basquiat's aesthetic makes of his paintings economies of accumulation, building a productive play of contingency from the mainstream's constructions of race. This aesthetic move speaks to a need for escape from the perceived epistemic necessities of blackness. Through these economies of accumulation we see, as Tate has pointed out, Basquiat's “intellectual obsession” with issues such as ancestry/modernity, personhood/property and originality/origins of knowledge, driven by his tireless need to problematize mainstream media's discourses surrounding race – in other words, a commodified American Africanism.",
"issue": "2",
"language": "en",
"libraryCatalog": "Cambridge Core",
"pages": "227-243",
"publicationTitle": "Journal of American Studies",
"shortTitle": "“SAMO© as an Escape Clause”",
"url": "https://www.cambridge.org/core/journals/journal-of-american-studies/article/abs/samo-as-an-escape-clause-jean-michel-basquiats-engagement-with-a-commodified-american-africanism/1E4368D610A957B84F6DA3A58B8BF164",
"volume": "45",
"attachments": [
{
"title": "Full Text PDF",
"mimeType": "application/pdf"
},
{
"title": "Snapshot",
"mimeType": "text/html"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "https://www.cambridge.org/core/journals/journal-of-fluid-mechanics/article/abs/high-resolution-simulations-of-cylindrical-density-currents/30D62864BDED84A6CC81F5823950767B",
"items": [
{
"itemType": "journalArticle",
"title": "High-resolution simulations of cylindrical density currents",
"creators": [
{
"firstName": "Mariano I.",
"lastName": "Cantero",
"creatorType": "author"
},
{
"firstName": "S.",
"lastName": "Balachandar",
"creatorType": "author"
},
{
"firstName": "Marcelo H.",
"lastName": "Garcia",
"creatorType": "author"
}
],
"date": "2007/11",
"DOI": "10.1017/S0022112007008166",
"ISSN": "1469-7645, 0022-1120",
"abstractNote": "Three-dimensional highly resolved simulations are presented for cylindrical density currents using the Boussinesq approximation for small density difference. Three Reynolds numbers (Re) are investigated (895, 3450 and 8950, which correspond to values of the Grashof number of 105, 1.5 × 106 and 107, respectively) in order to identify differences in the flow structure and dynamics. The simulations are performed using a fully de-aliased pseudospectral code that captures the complete range of time and length scales of the flow. The simulated flows present the main features observed in experiments at large Re. As the current develops, it transitions through different phases of spreading, namely acceleration, slumping, inertial and viscous Soon after release the interface between light and heavy fluids rolls up forming Kelvin–Helmholtz vortices. The formation of the first vortex sets the transition between acceleration and slumping phases. Vortex formation continues only during the slumping phase and the formation of the last Kelvin–Helmholtz vortex signals the departure from the slumping phase. The coherent Kelvin–Helmholtz vortices undergo azimuthal instabilities and eventually break up into small-scale turbulence. In the case of planar currents this turbulent region extends over the entire body of the current, while in the cylindrical case it only extends to the regions of Kelvin–Helmholtz vortex breakup. The flow develops three-dimensionality right from the beginning with incipient lobes and clefts forming at the lower frontal region. These instabilities grow in size and extend to the upper part of the front. Lobes and clefts continuously merge and split and result in a complex pattern that evolves very dynamically. The wavelength of the lobes grows as the flow spreads, while the local Re of the flow decreases. However, the number of lobes is maintained over time. Owing to the high resolution of the simulations, we have been able to link the lobe and cleft structure to local flow patterns and vortical structures. In the near-front region and body of the current several hairpin vortices populate the flow. Laboratory experiments have been performed at the higher Re and compared to the simulation results showing good agreement. Movies are available with the online version of the paper.",
"language": "en",
"libraryCatalog": "Cambridge Core",
"pages": "437-469",
"publicationTitle": "Journal of Fluid Mechanics",
"url": "https://www.cambridge.org/core/journals/journal-of-fluid-mechanics/article/abs/high-resolution-simulations-of-cylindrical-density-currents/30D62864BDED84A6CC81F5823950767B",
"volume": "590",
"attachments": [
{
"title": "Full Text PDF",
"mimeType": "application/pdf"
},
{
"title": "Snapshot",
"mimeType": "text/html"
}
],
"tags": [
{
"tag": "Gravity currents"
},
{
"tag": "Vortex breakdown"
}
],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "https://www.cambridge.org/core/journals/american-political-science-review/issue/F6F2E8238A6D139A91D343A62AB2CECC",
"items": "multiple"
},
{
"type": "web",
"url": "https://www.cambridge.org/core/search?q=labor&sort=&aggs%5BonlyShowAvailable%5D%5Bfilters%5D=&aggs%5BopenAccess%5D%5Bfilters%5D=&aggs%5BproductTypes%5D%5Bfilters%5D=JOURNAL_ARTICLE&aggs%5BproductDate%5D%5Bfilters%5D=&aggs%5BproductSubject%5D%5Bfilters%5D=&aggs%5BproductJournal%5D%5Bfilters%5D=&aggs%5BproductPublisher%5D%5Bfilters%5D=&aggs%5BproductSociety%5D%5Bfilters%5D=&aggs%5BproductPublisherSeries%5D%5Bfilters%5D=&aggs%5BproductCollection%5D%5Bfilters%5D=&showJackets=&filters%5BauthorTerms%5D=&filters%5BdateYearRange%5D%5Bfrom%5D=&filters%5BdateYearRange%5D%5Bto%5D=&hideArticleGraphicalAbstracts=true",
"items": [
{
"itemType": "journalArticle",
"title": "Search",
"creators": [],
"abstractNote": "Welcome to Cambridge Core",
"language": "en",
"libraryCatalog": "Cambridge Core",
"url": "https://www.cambridge.org/core/search?q=labor&sort=&aggs%5BonlyShowAvailable%5D%5Bfilters%5D=&aggs%5BopenAccess%5D%5Bfilters%5D=&aggs%5BproductTypes%5D%5Bfilters%5D=JOURNAL_ARTICLE&aggs%5BproductDate%5D%5Bfilters%5D=&aggs%5BproductSubject%5D%5Bfilters%5D=&aggs%5BproductJournal%5D%5Bfilters%5D=&aggs%5BproductPublisher%5D%5Bfilters%5D=&aggs%5BproductSociety%5D%5Bfilters%5D=&aggs%5BproductPublisherSeries%5D%5Bfilters%5D=&aggs%5BproductCollection%5D%5Bfilters%5D=&showJackets=&filters%5BauthorTerms%5D=&filters%5BdateYearRange%5D%5Bfrom%5D=&filters%5BdateYearRange%5D%5Bto%5D=&hideArticleGraphicalAbstracts=true",
"attachments": [
{
"title": "Snapshot",
"mimeType": "text/html"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "https://www.cambridge.org/core/journals/journal-of-ecclesiastical-history/article/abs/history-of-christian-conversion-by-david-w-kling-pp-xvi-836-incl-14-maps-oxfordnew-york-oxford-university-press-2020-97-978-0-19-532092-3/5FD53AEBA7196F39CDD81DBE84DA4A5C",
"items": [
{
"itemType": "journalArticle",
"title": "A history of Christian conversion. By David W. Kling. Pp. xvi + 836 incl. 14 maps. Oxford–New York: Oxford University Press, 2020. £97. 978 0 19 532092 3",
"creators": [
{
"firstName": "David",
"lastName": "Bebbington",
"creatorType": "author"
}
],
"date": "2021/07",
"DOI": "10.1017/S002204692100035X",
"ISSN": "0022-0469, 1469-7637",
"issue": "3",
"language": "en",
"libraryCatalog": "Cambridge Core",
"pages": "612-613",
"publicationTitle": "The Journal of Ecclesiastical History",
"shortTitle": "A history of Christian conversion. By David W. Kling. Pp. xvi + 836 incl. 14 maps. Oxford–New York",
"url": "https://www.cambridge.org/core/journals/journal-of-ecclesiastical-history/article/abs/history-of-christian-conversion-by-david-w-kling-pp-xvi-836-incl-14-maps-oxfordnew-york-oxford-university-press-2020-97-978-0-19-532092-3/5FD53AEBA7196F39CDD81DBE84DA4A5C",
"volume": "72",
"attachments": [
{
"title": "Full Text PDF",
"mimeType": "application/pdf"
},
{
"title": "Snapshot",
"mimeType": "text/html"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "https://www.cambridge.org/core/journals/journal-of-ecclesiastical-history/article/charity-as-social-justice-antonio-rosmini-and-the-great-irish-famine/7D177F707EA3722731C61AE58DB601F6",
"items": [
{
"itemType": "journalArticle",
"title": "Charity as Social Justice: Antonio Rosmini and the Great Irish Famine",
"creators": [
{
"firstName": "Francesco",
"lastName": "Zavatti",
"creatorType": "author"
}
],
"date": "2021/07",
"DOI": "10.1017/S0022046920001499",
"ISSN": "0022-0469, 1469-7637",
"abstractNote": "The article sheds light on the significant fundraising and relief activities for Ireland during the Great Famine (1845–50) initiated in 1847 by the Italian philosopher and cleric Antonio Rosmini and his network in Savoy-Piedmont, Lombardy-Venetia and England. By analysing Rosmini's philosophical and political writings, the article demonstrates that Rosmini considered aid in times of crisis as an act of social justice for which individuals have to take responsibility. By analysing documents from the Italian and Irish archives, the article gives an account of the fundraising effort's practices of networking, appealing, almsgiving and delivery.",
"issue": "3",
"language": "en",
"libraryCatalog": "Cambridge Core",
"pages": "573-589",
"publicationTitle": "The Journal of Ecclesiastical History",
"shortTitle": "Charity as Social Justice",
"url": "https://www.cambridge.org/core/journals/journal-of-ecclesiastical-history/article/charity-as-social-justice-antonio-rosmini-and-the-great-irish-famine/7D177F707EA3722731C61AE58DB601F6",
"volume": "72",
"attachments": [
{
"title": "Full Text PDF",
"mimeType": "application/pdf"
},
{
"title": "Snapshot",
"mimeType": "text/html"
}
],
"tags": [
{
"tag": "Archive of the Institute of Charity"
},
{
"tag": "Archivo Generalizio"
},
{
"tag": "Dublin"
},
{
"tag": "Dublin Diocesan Archive"
},
{
"tag": "New Collection"
},
{
"tag": "Pontifical Irish College"
},
{
"tag": "Rome"
},
{
"tag": "Stresa"
}
],
"notes": [
"LF:"
],
"seeAlso": []
}
]
}
]
/** END TEST CASES **/