Skip to content

Commit 0c7b099

Browse files
committed
test updates: AIP, Cell, IBIS, Ingetna, Isitore, Medium;
Fix to CanLII and biblio.com after minor site redesigns; Small fix to finding importable multiples on frontiers; Improve detectWeb precision for Atypon
1 parent bd3b5b2 commit 0c7b099

File tree

10 files changed

+64
-172
lines changed

10 files changed

+64
-172
lines changed

AIP.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ var testCases = [
183183
}
184184
],
185185
"title": "Local stabilisation of polar order at charged antiphase boundaries in antiferroelectric (Bi0.85Nd0.15)(Ti0.1Fe0.9)O3",
186-
"date": "2013/08/13",
186+
"date": "2013/08/01",
187187
"publicationTitle": "APL Materials",
188188
"volume": "1",
189189
"issue": "2",
@@ -271,19 +271,23 @@ var testCases = [
271271
"attachments": [
272272
{
273273
"title": "Snapshot"
274+
},
275+
{
276+
"title": "Full Text PDF",
277+
"mimeType": "application/pdf"
274278
}
275279
],
280+
"title": "Low‐field magnetoresistance and domain drag in ferromagnets",
281+
"date": "1978/03/01",
282+
"publicationTitle": "Journal of Applied Physics",
283+
"volume": "49",
276284
"issue": "3",
277285
"abstractNote": "Despite common misconceptions, domain walls are too thick to ’’scatter’’ electrons appreciably. However, electrons crossing a wall apply a torque to it, which tends to cant the wall spins. This could be used to measure the conduction electron spin polarization. Most of the low‐field resistive anomalies observed in pure Fe, Ni and Co at low temperature are caused by the Lorentz force associated with the internal field B=M s present inside each domain. The existence of low‐resistivity paths extending over many domains accounts for still unexplained magnetoresistance data in ironwhiskers. In uniaxial materials, a d.c. eddy‐current loop caused by the Hall effect runs around each wall. The field H z generated by these loops tends to ’’drag’’ the whole domain structure in the direction of the carrier drift velocity. Also, the Joule dissipation of the eddy currents manifests itself as an excess Ohmic resistance. As predicted, this excess resistance decreases as the square of the field, in amorphous Gd25Co75 films, in MnBi films, and in pure bulk cobalt, when the walls are removed by an external field. The excess resistance can also be changed by reorienting the walls.",
278286
"DOI": "10.1063/1.324716",
287+
"pages": "2156-2161",
279288
"ISSN": "0021-8979, 1089-7550",
280289
"url": "http://scitation.aip.org/content/aip/journal/jap/49/3/10.1063/1.324716",
281-
"libraryCatalog": "scitation.aip.org",
282-
"title": "Low‐field magnetoresistance and domain drag in ferromagnets",
283-
"date": "1978",
284-
"publicationTitle": "Journal of Applied Physics",
285-
"volume": "49",
286-
"pages": "2156-2161"
290+
"libraryCatalog": "scitation.aip.org"
287291
}
288292
]
289293
}

Atypon Journals.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"inRepository": true,
1010
"translatorType": 4,
1111
"browserSupport": "gcsibv",
12-
"lastUpdated": "2014-04-22 00:37:48"
12+
"lastUpdated": "2014-04-28 21:01:10"
1313
}
1414

1515
/*
@@ -39,7 +39,9 @@ function detectWeb(doc, url) {
3939
if (url.indexOf('/doi/book/') != -1) {
4040
return 'book';
4141
}
42-
42+
else if (url.search(/\.ch\d+$/)!=-1){
43+
return 'bookSection';
44+
}
4345
return "journalArticle";
4446
}
4547

Biblio.com.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
"inRepository": true,
1010
"translatorType": 4,
1111
"browserSupport": "gcsibv",
12-
"lastUpdated": "2014-01-19 23:44:31"
12+
"lastUpdated": "2014-04-28 19:32:32"
1313
}
1414

1515
function detectWeb(doc, url) {
1616
if (doc.location.href.match("bookseller_search") || doc.location.href.match("bookstores") || doc.location.href.match("textbooks")) {
1717

18-
} else if (doc.location.href.match("search")) {
18+
} else if (doc.location.href.search(/\/search\.php/)!=-1) {
1919
return "multiple";
20-
} else if (doc.location.href.match("books")) {
20+
} else if (doc.location.href.search(/\/book/)!=-1) {
2121
return "book";
2222
}
2323
}
@@ -113,7 +113,7 @@ var testCases = [
113113
},
114114
{
115115
"type": "web",
116-
"url": "http://www.biblio.com/books/29965287.html",
116+
"url": "http://www.biblio.com/book/through-year-dickens-compiled-his-eldest/d/29965287",
117117
"items": [
118118
{
119119
"itemType": "book",
@@ -133,7 +133,7 @@ var testCases = [
133133
"date": "1909",
134134
"edition": "First American",
135135
"title": "Through The Year With Dickens. Compiled by his Eldest Daughter",
136-
"url": "http://www.biblio.com/books/29965287.html",
136+
"url": "http://www.biblio.com/book/through-year-dickens-compiled-his-eldest/d/29965287",
137137
"libraryCatalog": "Biblio.com",
138138
"accessDate": "CURRENT_TIMESTAMP"
139139
}

CanLII (English).js

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"inRepository": true,
1010
"translatorType": 4,
1111
"browserSupport": "gcsibv",
12-
"lastUpdated": "2014-03-31 14:05:47"
12+
"lastUpdated": "2014-04-28 19:52:25"
1313
}
1414

1515
var canLiiRegexp = /https?:\/\/(www\.)?canlii\.org\/.*en\/[^\/]+\/[^\/]+\/doc\/.+/;
@@ -29,10 +29,10 @@ function detectWeb(doc, url) {
2929
}
3030

3131

32-
function scrape(doc) {
32+
function scrape(doc, url) {
3333

3434
var newItem = new Zotero.Item("case");
35-
var voliss = ZU.xpathText(doc, '//td[@class="canlii-label" and contains(text(), "Citation:")]/following-sibling::td');
35+
var voliss = ZU.xpathText(doc, '//td[contains(@class, "canlii-label") and contains(text(), "Citation:")]/following-sibling::td');
3636
//Z.debug("voliss: ("+voliss+")")
3737
var casename = voliss.match(/.+?,/)[0].replace(/,/, "").trim();
3838
//Z.debug("casename: ("+casename+")");
@@ -45,25 +45,27 @@ function scrape(doc) {
4545
var reporterpg = voliss.match(/\]\s*\d+\s*[A-Z]+\s*\d+/);
4646
//Z.debug("reporterpg: ("+reporterpg+")");
4747
var page = voliss.match(/,\s*\d{4}\s*[A-Z]+\s*\d+/);
48-
var date = ZU.xpathText(doc, '//td[@class="canlii-label" and contains(text(), "Date:")]/following-sibling::td');
49-
//Z.debug("date: ("+date+")")
50-
var docket = ZU.xpathText(doc, '//td[@class="canlii-label" and contains(text(), "Docket:")]/following-sibling::td');
51-
//Z.debug("docket: ("+docket+")")
48+
var dateDocket = ZU.xpathText(doc, '//td[@class="canlii-label" and contains(text(), "Date:")]/following-sibling::td');
5249

5350
newItem.caseName = newItem.title = casename;
5451
if (court) newItem.court = court[0].replace(/,\s*\d{4}\s*/, "").trim();;
5552
if (reporter) newItem.reporter = reporter[0].replace(/\]\s*\d+\s*/, "");
56-
newItem.dateDecided = date;
57-
if (docket) newItem.docketNumber = docket.trim();
53+
54+
if (dateDocket){
55+
var date = dateDocket.match(/\d{4}-\d{2}-\d{2}/);
56+
if (date) newItem.dateDecided = date[0];
57+
var docket = ZU.trimInternal(dateDocket).match(/\(Docket:(.+?)\)/);
58+
if (docket) newItem.docketNumber = docket[1];
59+
}
5860
if (reporterpg) newItem.firstPage = reporterpg[0].replace(/\]\s*\d+\s*[A-Z]+\s*/, "");
5961
//
6062
if (!reporterpg && page) newItem.firstPage = page[0].replace(/,\s*\d{4}\s*[A-Z]+\s*/, "");
6163
if (reportvl) newItem.reporterVolume = reportvl[0].replace(/\]\s*/, "");
6264

6365
// attach link to pdf version
64-
var pdfurl = ZU.xpathText(doc, '//td/a[contains(text(), "PDF Format")]/@href');
66+
Z.debug(url)
67+
var pdfurl = url.replace(/\.html.+/, ".pdf");
6568
if (pdfurl) {
66-
pdfurl = "http://canlii.ca" + pdfurl;
6769
newItem.attachments = [{
6870
url: pdfurl,
6971
title: "CanLII Full Text PDF",
@@ -93,10 +95,7 @@ function doWeb(doc, url) {
9395
for (var i in items) {
9496
articles.push(i);
9597
}
96-
Zotero.Utilities.processDocuments(articles, scrape, function () {
97-
Zotero.done();
98-
});
99-
Zotero.wait();
98+
Zotero.Utilities.processDocuments(articles, scrape);
10099
});
101100
}
102101
}

Cell Press.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,18 +416,16 @@ var testCases = [
416416
],
417417
"title": "Punishment and cooperation in nature",
418418
"date": "01/05/2012",
419-
"publicationTitle": "Trends in Ecology & Evolution",
419+
"publicationTitle": "Trends in Ecology & Evolution",
420420
"volume": "27",
421421
"issue": "5",
422-
"publisher": "Elsevier",
423422
"DOI": "10.1016/j.tree.2011.12.004",
424423
"language": "English",
425424
"pages": "288-295",
426425
"ISSN": "0169-5347",
427426
"extra": "PMID: 22284810",
428427
"url": "http://www.cell.com/article/S016953471200002X/abstract",
429428
"libraryCatalog": "www.cell.com",
430-
"accessDate": "CURRENT_TIMESTAMP",
431429
"abstractNote": "Humans use punishment to promote cooperation in laboratory experiments but evidence that punishment plays a similar role in non-human animals is comparatively rare. In this article, we examine why this may be the case by reviewing evidence from both laboratory experiments on humans and ecologically relevant studies on non-human animals. Generally, punishment appears to be most probable if players differ in strength or strategic options. Although these conditions are common in nature, punishment (unlike other forms of aggression) involves immediate payoff reductions to both punisher and target, with net benefits to punishers contingent on cheats behaving more cooperatively in future interactions. In many cases, aggression yielding immediate benefits may suffice to deter cheats and might explain the relative scarcity of punishment in nature."
432430
}
433431
]

Frontiers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"inRepository": true,
1010
"translatorType": 4,
1111
"browserSupport": "gcsibv",
12-
"lastUpdated": "2014-03-12 04:43:57"
12+
"lastUpdated": "2014-04-28 20:54:37"
1313
}
1414

1515
/*
@@ -44,7 +44,7 @@ function detectWeb(doc, url) {
4444

4545
function getItems(doc, url) {
4646
var items = {};
47-
var links = doc.evaluate('//*[@class="AS55"]/a[contains(@title, " ")]', doc, null, XPathResult.ANY_TYPE, null);
47+
var links = doc.evaluate('//*[@class="AS55"]/a[contains(@title, " ") or contains(@title, "/")]', doc, null, XPathResult.ANY_TYPE, null);
4848
while (link = links.iterateNext()) {
4949
if (link.href.indexOf("/abstract") === -1) continue;
5050
items[link.href] = link.textContent;

IBISWorld.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ var testCases = [
148148
}
149149
],
150150
"url": "http://clients1.ibisworld.com/reports/us/riskrating/default.aspx?entid=1281",
151-
"date": "March 2014",
151+
"date": "April 2014",
152152
"institution": "IBISWorld Services",
153153
"place": "Melbourne, Australia",
154154
"reportNumber": "51821",

IngentaConnect.js

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"inRepository": true,
1010
"translatorType": 4,
1111
"browserSupport": "gcsibv",
12-
"lastUpdated": "2013-12-12 12:55:31"
12+
"lastUpdated": "2014-04-28 21:03:15"
1313
}
1414

1515
function detectWeb(doc, url) {
@@ -98,48 +98,38 @@ function scrape(newDoc, url){
9898
var testCases = [
9999
{
100100
"type": "web",
101-
"url": "http://www.ingentaconnect.com/content/klu/10436/2007/00000003/00000001/00000064",
101+
"url": "http://www.ingentaconnect.com/search;jsessionid=296g394n0j012.alice?form_name=quicksearch&ie=%E0%A5%B0&value1=argentina&option1=tka&x=0&y=0",
102+
"items": "multiple"
103+
},
104+
{
105+
"type": "web",
106+
"url": "http://www.ingentaconnect.com/search/article?option1=tka&value1=labor+market&pageSize=10&index=10",
102107
"items": [
103108
{
104109
"itemType": "journalArticle",
105110
"creators": [
106111
{
107-
"lastName": "Calomiris",
108-
"firstName": "Charles",
112+
"lastName": "Brinton",
113+
"firstName": "M.C.",
109114
"creatorType": "author"
110115
}
111116
],
112117
"notes": [],
113-
"tags": [
114-
"Argentina",
115-
"Devaluation",
116-
"E42",
117-
"F30",
118-
"G3",
119-
"G32",
120-
"K2",
121-
"Pesification",
122-
"Redenomination"
123-
],
118+
"tags": [],
124119
"seeAlso": [],
125120
"attachments": [],
126-
"title": "Devaluation with contract redenomination in Argentina",
127-
"journalAbbreviation": "Annals of Finance",
128-
"volume": "3",
129-
"issue": "1",
130-
"pages": "155-192",
131-
"abstractNote": "This study offers the first empirical microeconomic analysis of the effectiveness of dollar debt and contract redenomination policies to mitigate adverse financial and relative price consequences from a large devaluation. An analysis of Argentina’s policy of devaluation with redenomination in 2002, in contrast to Mexico’s policy of devaluation without debt redenomination in 1994–1995, shows that devaluation benefited tradables firms, and that dollar debt redenomination in Argentina benefited high-dollar debtors, as shown in these firms’ investment behavior, especially non-tradables firms whose revenues in dollar terms were adversely affected by devaluation. That investment behavior contrasts with the experience of Mexican firms in the aftermath of Mexico’s large devaluation, in which non-tradables producers with high dollar debt displayed significant relative reductions in investment. Stock return reactions to Argentine debt redenomination indicate large, positive, unanticipated effects on high-dollar debtors from debt redenomination. Energy concession contract redenomination likewise increased investment by high energy users in Argentina, and that benefit was apparent also in positive stock returns of those firms.",
132-
"DOI": "10.1007/s10436-006-0064-9",
133-
"date": "2007",
134-
"publicationTitle": "Annals of Finance",
135-
"libraryCatalog": "IngentaConnect"
121+
"title": "Social capital in the Japanese youth labor market: Labor market policy, schools, and norms",
122+
"journalAbbreviation": "Policy Sciences",
123+
"volume": "33",
124+
"issue": "3-1",
125+
"pages": "289-306",
126+
"abstractNote": "This paper develops the concept of institutional social capital and discusses its importance in the labor market. Institutional social capital is constituted by the resources inherent in an organization (such as a school) and thereby available to members of that organization. This is contrasted with the social capital available to individuals through their own personal networks. In the labor market context, an example of institutional social capital is the ties that schools have with employers who recruit a proportion of their new employees as they prepare to graduate. The paper examines how these ties and the norms governing the important labor market screening role played by the high school developed in post-WWII Japan. I also discuss an important positive externality – social control over students – generated by schools’ institutional social capital. Finally, I examine current challenges to Japanese high schools’ institutional social capital.",
127+
"date": "2000-12-01T00:00:00///",
128+
"publicationTitle": "Policy Sciences",
129+
"libraryCatalog": "IngentaConnect",
130+
"shortTitle": "Social capital in the Japanese youth labor market"
136131
}
137132
]
138-
},
139-
{
140-
"type": "web",
141-
"url": "http://www.ingentaconnect.com/search;jsessionid=296g394n0j012.alice?form_name=quicksearch&ie=%E0%A5%B0&value1=argentina&option1=tka&x=0&y=0",
142-
"items": "multiple"
143133
}
144134
]
145135
/** END TEST CASES **/

Isidore.js

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"inRepository": true,
1010
"translatorType": 4,
1111
"browserSupport": "gcsibv",
12-
"lastUpdated": "2013-11-18 22:53:58"
12+
"lastUpdated": "2014-04-28 21:06:26"
1313
}
1414

1515
var typeMap = {
@@ -484,79 +484,6 @@ var testCases = [
484484
"type": "web",
485485
"url": "http://rechercheisidore.fr/search/?type=http://www.rechercheisidore.fr/ontology/art",
486486
"items": "multiple"
487-
},
488-
{
489-
"type": "web",
490-
"url": "http://rechercheisidore.fr/search/resource/?uri=10670/1.mnjsvs",
491-
"items": [
492-
{
493-
"itemType": "newspaperArticle",
494-
"creators": [
495-
{
496-
"lastName": "Yu Jianrong",
497-
"creatorType": "author"
498-
}
499-
],
500-
"notes": [],
501-
"tags": [
502-
"Linguistique",
503-
"Linguistique",
504-
"Travail",
505-
"Thérapeutique par l'exercice",
506-
"travail",
507-
"Histoire",
508-
"histoire",
509-
"lutte politique",
510-
"Contrôle social",
511-
"bien",
512-
"Création",
513-
"Développement",
514-
"emploi",
515-
"Adaptations",
516-
"société",
517-
"Société",
518-
"droit",
519-
"Droit",
520-
"Police",
521-
"Nature",
522-
"nature",
523-
"Conséquence",
524-
"Justification (théologie)"
525-
],
526-
"seeAlso": [],
527-
"attachments": [
528-
{
529-
"title": "Snapshot"
530-
},
531-
{
532-
"title": "Isidore Record",
533-
"snapshot": false
534-
}
535-
],
536-
"title": "Le système de rééducation par le travail, instrument de la lutte politique et moyen de contrôle social",
537-
"publisher": "OpenEdition",
538-
"institution": "OpenEdition",
539-
"company": "OpenEdition",
540-
"label": "OpenEdition",
541-
"distributor": "OpenEdition",
542-
"date": "2010-06-01",
543-
"archiveLocation": "Époque contemporaine",
544-
"abstractNote": "Après un bref récapitulatif de l’histoire du système de rééducation par le travail ( laojiao), notre article conclut que la création et le développement de ce système peut se diviser de manière générale en deux phases : celle de la rééducation par le travail en tant qu’instrument de lutte politique et celle de la rééducation par le travail en tant que moyen de contrôle social. Bien qu’au cours de l’histoire, le laojiaoait été réformé plusieurs fois, que sa fonction et ses cibles aient connu de grandes variations, on peut dire que ces changements dans les tâches concrètes n’ont constitué que des adaptations du laojiaoaux exigences de la société à différentes époques, mais que la violation arbitraire du droit individuel par la force publique qui constitue la nature profonde de ce système, n’a jamais changé. En conséquence, bien que le système du laojiao, anomalie produite par l’histoire, continue de jouer un rôle aujourd’hui, la poursuite de son existence a déjà perdu toute justification et toute légitimité.",
545-
"reportType": "Actualités",
546-
"letterType": "Actualités",
547-
"manuscriptType": "Actualités",
548-
"mapType": "Actualités",
549-
"thesisType": "Actualités",
550-
"websiteType": "Actualités",
551-
"presentationType": "Actualités",
552-
"postType": "Actualités",
553-
"audioFileType": "Actualités",
554-
"url": "http://perspectiveschinoises.revues.org/5625",
555-
"libraryCatalog": "rechercheisidore.fr",
556-
"accessDate": "CURRENT_TIMESTAMP",
557-
"language": "Français"
558-
}
559-
]
560487
}
561488
]
562489
/** END TEST CASES **/

0 commit comments

Comments
 (0)