Skip to content
Permalink
Browse files

Test updates and small fixes - A (zotero#1133)

* Delete African Journals Online.js; covered by OJS
* Fix tests in AllAfrica.js
* Update tests in AlterNet.js
* Increase the number of translators in deleted.txt
* Update tests in Amazon.js
* Update tests in American Institute of Aeronautics and Astronautics.js
* Fix extraction of abstract in AMS Journals.js
Multiples (issue pages) are also working and therefore activated.
* Update tests in AMS MathSciNet.js
* Update tests in Annual Reviews.js
* Fix multiples and tests in APS.js
* Update tests and label for Archeion.js
* Update tests in ASCE.js
* Fix extraction and tests in ASCO Meeting Library.js
* Update tests in Australian Dictionary of Biography.js
* Add test for African Journals Online in OJS
* Update tests in Atypon Journals.js
The esajournals moved to Wiley.
* Fix multiples in arXiv.org.js
* Rewrite AMS Journals.js
  • Loading branch information...
zuphilip authored and adam3smith committed Sep 6, 2016
1 parent e33f23d commit e102b02ae99d8111e44d981d19518ad1f4ded69b
@@ -9,60 +9,64 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2013-12-04 16:57:35"
"lastUpdated": "2016-09-03 20:50:31"
}

function detectWeb(doc, url) {
if (url.match(/home\.html|\d{4}[^\/]*\/.+/)) {
return "journalArticle";
}
/*multiples are currently broken
else if (url.match(/jour(nals|search)/)) {
} else if (getSearchResults(doc, true)) {
return "multiple";
} */
}
}


function getSearchResults(doc, checkOnly) {
var items = {};
var found = false;
//This is tailored for the issue pages and may need
//adjusted for search (when this works again).
var rows = ZU.xpath(doc, '//div[@class="contentList"]/dl');
for (var i=0; i<rows.length; i++) {
var href = ZU.xpathText(rows[i], './/a[contains(text(), "Abstract") or contains(text(), "Review information") or contains(text(), "Review Information")]/@href');
var title = ZU.trimInternal(ZU.xpathText(rows[i], './/*[@class="articleTitleInAbstract" or @class="bookTitleInAbstract"]'));
if (!href || !title) continue;
if (checkOnly) return true;
found = true;
items[href] = title;
}
return found ? items : false;
}


function doWeb(doc, url) {
var articles = new Array();
if (detectWeb(doc, url) == "multiple") {
var items = new Object();
if (url.match(/joursearch/)) {
var titlex = '//table/tbody/tr/td/span[@class="searchResultsArticleTitle"]';
var linkx = '//a[@class="searchResultsAbstractLink"]';
} else {
var titlex = '//div[@class="contentList"]/dl/dt[@class="articleTitleInAbstract"]';
var linkx = '//div[@class="contentList"]/dl/dd/a[contains(text(), "Abstract")]'
}
var titles = doc.evaluate(titlex, doc, null, XPathResult.ANY_TYPE, null);
var links = doc.evaluate(linkx, doc, null, XPathResult.ANY_TYPE, null);
var title, link;
while ((title = titles.iterateNext()) && (link = links.iterateNext())) {
items[link.href] = Zotero.Utilities.trimInternal(title.textContent);
}
Zotero.selectItems(items, function (items) {
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)
scrape(doc, url);
}
}


function scrape(doc, url){
//Z.debug(url)
// We call the Embedded Metadata translator to do the actual work
var translator = Zotero.loadTranslator("web");
translator.setTranslator("951c027d-74ac-47d4-a107-9c3069ab7b48");
translator.setDocument(doc);
translator.setHandler("itemDone", function(obj, item) {
var abstract = ZU.xpathText(doc, '//td[@class="bottomCell"]/p[a[contains(@id, "Abstract")]]');
if (abstract) item.abstractNote = ZU.trimInternal(abstract.substr(10)).replace(/^A?bstract:\s/, "");
item.complete();
var abstract = ZU.xpathText(doc, '//p[a[contains(@id, "Abstract")]]');
if (abstract) item.abstractNote = ZU.trimInternal(abstract).replace(/^Abstract:\s/, "");
item.complete();
});
translator.translate();
}/** BEGIN TEST CASES **/
@@ -73,6 +77,7 @@ var testCases = [
"items": [
{
"itemType": "journalArticle",
"title": "Equivalences between fusion systems of finite groups of Lie type",
"creators": [
{
"firstName": "Carles",
@@ -90,14 +95,18 @@ var testCases = [
"creatorType": "author"
}
],
"notes": [],
"tags": [
"groups of Lie type",
"fusion systems",
"classifying spaces",
"𝑝-completion"
],
"seeAlso": [],
"date": "2012",
"DOI": "10.1090/S0894-0347-2011-00713-3",
"ISSN": "0894-0347, 1088-6834",
"abstractNote": "We prove, for certain pairs of finite groups of Lie type, that the -fusion systems and are equivalent. In other words, there is an isomorphism between a Sylow -subgroup of and one of which preserves -fusion. This occurs, for example, when and for a simple Lie ``type'' , and and are prime powers, both prime to , which generate the same closed subgroup of -adic units. Our proof uses homotopy-theoretic properties of the -completed classifying spaces of and , and we know of no purely algebraic proof of this result.",
"accessDate": "CURRENT_TIMESTAMP",
"issue": "1",
"journalAbbreviation": "J. Amer. Math. Soc.",
"libraryCatalog": "www.ams.org",
"pages": "1-20",
"publicationTitle": "Journal of the American Mathematical Society",
"url": "http://www.ams.org/jams/2012-25-01/S0894-0347-2011-00713-3/",
"volume": "25",
"attachments": [
{
"title": "Full Text PDF",
@@ -107,21 +116,21 @@ var testCases = [
"title": "Snapshot"
}
],
"title": "Equivalences between fusion systems of finite groups of Lie type",
"date": "2012",
"publicationTitle": "Journal of the American Mathematical Society",
"journalAbbreviation": "J. Amer. Math. Soc.",
"volume": "25",
"issue": "1",
"DOI": "10.1090/S0894-0347-2011-00713-3",
"pages": "1-20",
"ISSN": "0894-0347, 1088-6834",
"url": "http://www.ams.org/jams/2012-25-01/S0894-0347-2011-00713-3/",
"abstractNote": "We prove, for certain pairs of finite groups of Lie type, that the -fusion systems and are equivalent. In other words, there is an isomorphism between a Sylow -subgroup of and one of which preserves -fusion. This occurs, for example, when and for a simple Lie ``type'' , and and are prime powers, both prime to , which generate the same closed subgroup of -adic units. Our proof uses homotopy-theoretic properties of the -completed classifying spaces of and , and we know of no purely algebraic proof of this result.",
"libraryCatalog": "www.ams.org",
"accessDate": "CURRENT_TIMESTAMP"
"tags": [
"classifying spaces",
"fusion systems",
"groups of Lie type",
"𝑝-completion"
],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://www.ams.org/journals/bull/2016-53-03/",
"items": "multiple"
}
]
/** END TEST CASES **/
@@ -130,6 +130,7 @@ var testCases = [
"items": [
{
"itemType": "journalArticle",
"title": "Extrapolation of stable random fields",
"creators": [
{
"firstName": "Wolfgang",
@@ -147,26 +148,25 @@ var testCases = [
"creatorType": "author"
}
],
"notes": [],
"tags": [],
"seeAlso": [],
"attachments": [
{
"title": "MathSciNet Snapshot"
}
],
"itemID": "MR3004573",
"journalAbbreviation": "J. Multivariate Anal.",
"ISSN": "0047-259X",
"date": "2013",
"DOI": "10.1016/j.jmva.2012.11.004",
"url": "http://www.ams.org/mathscinet-getitem?mr=3004573",
"ISSN": "0047-259X",
"extra": "MR: 3004573",
"itemID": "MR3004573",
"journalAbbreviation": "J. Multivariate Anal.",
"libraryCatalog": "AMS MathSciNet",
"title": "Extrapolation of stable random fields",
"pages": "516–536",
"publicationTitle": "Journal of Multivariate Analysis",
"url": "http://www.ams.org/mathscinet-getitem?mr=3004573",
"volume": "115",
"date": "2013",
"pages": "516–536"
"attachments": [
{
"title": "MathSciNet Snapshot"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
@@ -181,6 +181,7 @@ var testCases = [
"items": [
{
"itemType": "bookSection",
"title": "On implementation of the Markov chain Monte Carlo stochastic approximation algorithm",
"creators": [
{
"firstName": "Yihua",
@@ -198,23 +199,22 @@ var testCases = [
"creatorType": "author"
}
],
"notes": [],
"tags": [],
"seeAlso": [],
"date": "2011",
"bookTitle": "Advances in directional and linear statistics",
"extra": "MR: 2767535",
"itemID": "MR2767535",
"libraryCatalog": "AMS MathSciNet",
"pages": "97–111",
"publisher": "Physica-Verlag/Springer, Heidelberg",
"url": "http://www.ams.org/mathscinet-getitem?mr=2767535",
"attachments": [
{
"title": "MathSciNet Snapshot"
}
],
"itemID": "MR2767535",
"url": "http://www.ams.org/mathscinet-getitem?mr=2767535",
"extra": "MR: 2767535",
"libraryCatalog": "AMS MathSciNet",
"title": "On implementation of the Markov chain Monte Carlo stochastic approximation algorithm",
"bookTitle": "Advances in directional and linear statistics",
"pages": "97–111",
"publisher": "Physica-Verlag/Springer, Heidelberg",
"date": "2011"
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
@@ -224,6 +224,7 @@ var testCases = [
"items": [
{
"itemType": "book",
"title": "Advances in directional and linear statistics",
"creators": [
{
"firstName": "Martin T.",
@@ -236,23 +237,22 @@ var testCases = [
"creatorType": "editor"
}
],
"notes": [],
"tags": [],
"seeAlso": [],
"date": "2011",
"ISBN": "9783790826272",
"extra": "A Festschrift for Sreenivasa Rao Jammalamadaka\nMR: 2663710",
"itemID": "MR2663710",
"libraryCatalog": "AMS MathSciNet",
"numPages": "xiv+321",
"publisher": "Physica-Verlag/Springer, Heidelberg",
"url": "http://www.ams.org/mathscinet-getitem?mr=2663710",
"attachments": [
{
"title": "MathSciNet Snapshot"
}
],
"itemID": "MR2663710",
"numPages": "xiv+321",
"ISBN": "978-3-7908-2627-2",
"url": "http://www.ams.org/mathscinet-getitem?mr=2663710",
"extra": "A Festschrift for Sreenivasa Rao Jammalamadaka\nMR: 2663710",
"libraryCatalog": "AMS MathSciNet",
"title": "Advances in directional and linear statistics",
"publisher": "Physica-Verlag/Springer, Heidelberg",
"date": "2011"
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
@@ -262,33 +262,33 @@ var testCases = [
"items": [
{
"itemType": "journalArticle",
"title": "Sommation des séries divergentes",
"creators": [
{
"firstName": "Bernard",
"lastName": "Malgrange",
"creatorType": "author"
}
],
"notes": [],
"tags": [],
"seeAlso": [],
"attachments": [
{
"title": "MathSciNet Snapshot"
}
],
"itemID": "MR1346201",
"journalAbbreviation": "Exposition. Math.",
"issue": "2-3",
"date": "1995",
"ISSN": "0723-0869",
"extra": "MR: 1346201",
"url": "http://www.ams.org/mathscinet-getitem?mr=1346201",
"issue": "2-3",
"itemID": "MR1346201",
"journalAbbreviation": "Exposition. Math.",
"libraryCatalog": "AMS MathSciNet",
"title": "Sommation des séries divergentes",
"pages": "163–222",
"publicationTitle": "Expositiones Mathematicae. International Journal",
"url": "http://www.ams.org/mathscinet-getitem?mr=1346201",
"volume": "13",
"date": "1995",
"pages": "163–222"
"attachments": [
{
"title": "MathSciNet Snapshot"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
}

0 comments on commit e102b02

Please sign in to comment.
You can’t perform that action at this time.