Skip to content
Permalink
Browse files

Fixes R (zotero#1320)

* Delete Readability.js as service was shut down
See https://medium.com/@readability/the-readability-bookmarking-service-will-shut-down-on-september-30-2016-1641cc18e02b for details
* Update REDALYC.js
* Update tests in RePEc - Econpapers.js
* Rewrite RePEc - IDEAS.js
* Update tests in Retsinformation.js
* Update test case
Also delete one test case which is now hosted at openedition.org
* Update Rock, Paper, Shotgun.js
* Delete ReliefWeb.js, see zotero#1319
* Rewrite Roll Call.js
* Update tests in RSC Publishing.js
  • Loading branch information...
zuphilip authored and adam3smith committed Jun 6, 2017
1 parent 68b7001 commit 95103c6631a109cf777e428bc2f74ba2b44033e5
Showing with 475 additions and 619 deletions.
  1. +72 −71 REDALYC.js
  2. +44 −39 RSC Publishing.js
  3. +1 −1 RePEc - Econpapers.js
  4. +183 −170 RePEc - IDEAS.js
  5. +0 −85 Readability.js
  6. +0 −59 ReliefWeb.js
  7. +2 −2 Retsinformation.js
  8. +78 −116 Revues.org.js
  9. +2 −2 Rock, Paper, Shotgun.js
  10. +90 −73 Roll Call.js
  11. +3 −1 deleted.txt
@@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2013-03-31 00:24:41"
"lastUpdated": "2017-06-04 09:52:26"
}

/*
@@ -31,61 +31,65 @@
*/

function detectWeb(doc,url) {
var xpath='//meta[@name="citation_journal_title"]';

if (ZU.xpath(doc, xpath).length > 0) {
if (url.indexOf('articulo.oa?id=')>-1) {
return "journalArticle";
} else if (getSearchResults(doc, true)) {
return "multiple";
}
if (url.indexOf("/home.oa")!=-1) {
var searchxpath = "//a[contains(@href, 'articulo.oa?id=') and span[@class='titulo-resultado']]|//span[@class='resultado-articulo']/a[contains(@href, 'articulo.oa?id=')]"
if (ZU.xpath(doc, searchxpath).length>0) {
return "multiple";
}
}
if (url.indexOf("/toc.oa?")!=-1) {
var tocxpath = "//a[contains(@href, 'articulo.oa?id=') and span[@class='articulo-fasciculo']]";
if (ZU.xpath(doc, tocxpath).length>0) {
return "multiple";
}
}


function getSearchResults(doc, checkOnly) {
var items = {};
var found = false;
var rows = ZU.xpath(doc, '//a[contains(@href, "articulo.oa?id=") and span]');
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 false;
return found ? items : false;
}


function doWeb(doc,url)
{
function doWeb(doc, url) {
if (detectWeb(doc, url) == "multiple") {
var hits = {};
var urls = [];
var results = ZU.xpath(doc,"//a[contains(@href, 'articulo.oa?id=') and span[@class='titulo-resultado']]|\
//span[@class='resultado-articulo']/a[contains(@href, 'articulo.oa?id=')]");
if (results.length<1){
results = ZU.xpath(doc, "//a[contains(@href, 'articulo.oa?id=') and span[@class='articulo-fasciculo']]");
}
for (var i in results) {
hits[results[i].href] = results[i].textContent.replace(/\[pdf\]\s* Redalyc\.?/, "");
}
Z.selectItems(hits, function(items) {
if (items == null) return true;
for (var j in items) {
urls.push(j);
Zotero.selectItems(getSearchResults(doc, false), function (items) {
if (!items) {
return true;
}
ZU.processDocuments(urls, doWeb);
});
} else {
var translator = Zotero.loadTranslator('web');
//use Embedded Metadata
translator.setTranslator("951c027d-74ac-47d4-a107-9c3069ab7b48");
translator.setDocument(doc);
translator.setHandler('itemDone', function(obj, item) {
if (item.title == item.title.toUpperCase()){
item.title = ZU.capitalizeTitle(item.title.toLowerCase(), true)
var articles = [];
for (var i in items) {
articles.push(i);
}
item.complete();
ZU.processDocuments(articles, scrape);
});
translator.translate();
};
} else {
scrape(doc, url);
}
}


function scrape(doc, url) {
var translator = Zotero.loadTranslator('web');
//use Embedded Metadata
translator.setTranslator("951c027d-74ac-47d4-a107-9c3069ab7b48");
translator.setDocument(doc);
translator.setHandler('itemDone', function(obj, item) {
if (item.title == item.title.toUpperCase()){
item.title = ZU.capitalizeTitle(item.title.toLowerCase(), true)
}
item.complete();
});
translator.getTranslatorObject(function(trans) {
trans.itemType = "journalArticle";
trans.doWeb(doc, url);
});
}

/** BEGIN TEST CASES **/
var testCases = [
{
@@ -94,6 +98,7 @@ var testCases = [
"items": [
{
"itemType": "journalArticle",
"title": "Os partidos políticos brasileiros realmente não importam?",
"creators": [
{
"firstName": "Maria do Socorro Sousa",
@@ -106,20 +111,16 @@ var testCases = [
"creatorType": "author"
}
],
"notes": [],
"tags": [
"CSES-ESEB2010",
"ESEB2010",
"Partidos políticos",
"Political parties",
"comportamento eleitoral",
"electoral behavior",
"eleições presidenciais",
"party sympathy",
"presidential elections",
"simpatia partidária"
],
"seeAlso": [],
"date": "2011",
"ISSN": "1807-0191",
"abstractNote": "Há décadas a constatação corrente no Brasil é de que os partidos pouco importam para explicar o comportamento dos eleitores brasileiros. Entretanto, esse cen...",
"issue": "2",
"language": "pt",
"libraryCatalog": "www.redalyc.org",
"pages": "271-303",
"publicationTitle": "Opinião Pública",
"url": "http://www.redalyc.org/articulo.oa?id=32921102001",
"volume": "17",
"attachments": [
{
"title": "Full Text PDF",
@@ -129,23 +130,23 @@ var testCases = [
"title": "Snapshot"
}
],
"title": "Os partidos políticos brasileiros realmente não importam?",
"publicationTitle": "Opinião Pública",
"abstractNote": "Há décadas a constatação corrente no Brasil é de que os partidos pouco importam para explicar o comportamento dos eleitores brasileiros. Entretanto, esse cenário de baixa identificação partidária contrasta com a observação de que, ao menos para as eleições presidenciais a competição eleitoral tem se...",
"date": "2011",
"volume": "17",
"issue": "2",
"language": "pt",
"pages": "271-303",
"ISSN": "0104-6276, 1807-0191",
"url": "http://www.redalyc.org/resumen.oa?id=32921102001",
"libraryCatalog": "www.redalyc.org"
"tags": [
"ESEB2010.>>>Political parties",
"Partidos políticos",
"comportamento eleitoral",
"electoral behavior",
"eleições presidenciais",
"presidential ele...",
"simpatia partidária"
],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://www.redalyc.org/toc.oa?id=329&numero=21102",
"url": "http://www.redalyc.org/BusquedaAutorPorNombre.oa?q=%22Maria%20do%20Socorro%20%20Sousa%20Braga%22",
"items": "multiple"
}
]
@@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsb",
"lastUpdated": "2017-03-30 04:27:42"
"lastUpdated": "2017-06-04 17:59:52"
}

/*
@@ -73,6 +73,10 @@ function scrape(doc, type) {
if(item.tags.length == 1 && !item.tags[0]) {
item.tags = [];
}

if (item.date) {
item.date = ZU.strToISO(item.date);
}

if (item.itemType == "bookSection") {
if (item.DOI){
@@ -116,6 +120,7 @@ var testCases = [
"items": [
{
"itemType": "journalArticle",
"title": "Superior radical polymer cathode material with a two-electron process redox reaction promoted by graphene",
"creators": [
{
"firstName": "Wei",
@@ -143,9 +148,24 @@ var testCases = [
"creatorType": "author"
}
],
"notes": [],
"tags": [],
"seeAlso": [],
"date": "2012-01-01",
"DOI": "10.1039/C1EE02148F",
"ISSN": "1754-5706",
"abstractNote": "Poly(2,2,6,6-tetramethyl-1-piperidinyloxy-4-yl methacrylate) (PTMA) displays a two–electron process redox reaction, high capacity of up to 222 mA h g−1, good rate performance and long cycle life, which is promoted by graphene as cathode material for lithium rechargeable batteries.",
"accessDate": "CURRENT_TIMESTAMP",
"company": "The Royal Society of Chemistry",
"distributor": "The Royal Society of Chemistry",
"institution": "The Royal Society of Chemistry",
"issue": "1",
"journalAbbreviation": "Energy Environ. Sci.",
"label": "The Royal Society of Chemistry",
"language": "en",
"libraryCatalog": "pubs.rsc.org",
"pages": "5221-5225",
"publicationTitle": "Energy & Environmental Science",
"publisher": "The Royal Society of Chemistry",
"url": "http://pubs.rsc.org/en/content/articlelanding/2012/ee/c1ee02148f",
"volume": "5",
"attachments": [
{
"title": "Full Text PDF",
@@ -155,34 +175,19 @@ var testCases = [
"title": "Snapshot"
}
],
"title": "Superior radical polymer cathode material with a two-electron process redox reaction promoted by graphene",
"publisher": "The Royal Society of Chemistry",
"institution": "The Royal Society of Chemistry",
"company": "The Royal Society of Chemistry",
"label": "The Royal Society of Chemistry",
"distributor": "The Royal Society of Chemistry",
"DOI": "10.1039/C1EE02148F",
"language": "en",
"date": "2012-01-01",
"publicationTitle": "Energy & Environmental Science",
"journalAbbreviation": "Energy Environ. Sci.",
"volume": "5",
"issue": "1",
"pages": "5221-5225",
"ISSN": "1754-5706",
"url": "http://pubs.rsc.org/en/content/articlelanding/2012/ee/c1ee02148f",
"abstractNote": "Poly(2,2,6,6-tetramethyl-1-piperidinyloxy-4-yl methacrylate) (PTMA) displays a two–electron process redox reaction, high capacity of up to 222 mA h g−1, good rate performance and long cycle life, which is promoted by graphene as cathode material for lithium rechargeable batteries.",
"libraryCatalog": "pubs.rsc.org",
"accessDate": "CURRENT_TIMESTAMP"
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://pubs.rsc.org/en/content/chapter/bk9781849730518-00330/978-1-84973-051-8",
"url": "http://pubs.rsc.org/en/content/chapter/bk9781849730518-00330/978-1-84973-051-8#!divabstract",
"items": [
{
"itemType": "bookSection",
"title": "Chapter 14:In Vivo Approaches to Predictive Toxicology Using Zebrafish",
"creators": [
{
"firstName": "Michael T.",
@@ -200,9 +205,15 @@ var testCases = [
"creatorType": "author"
}
],
"notes": [],
"tags": [],
"seeAlso": [],
"date": "2011-11-15",
"abstractNote": "A key to sustainability in modern paradigms of drug discovery and toxicology will be predictive structure–activity relationships based on vertebrate-model responses. The zebrafish embryo is the emerging vertebrate choice for rapid-throughput chemical screening, providing a quick and inexpensive way to test hypotheses and to generate strategies for complementary integrative research with rodent models, and humans. Numerous embryonic zebrafish assays and omics approaches appear to predict hazard in mammals. We review physiologic parameters of the zebrafish that are amenable to rapid-throughput screening. Toxicity investigations in the zebrafish have included endpoints in developmental, neuro, cardio, ocular, otic, gastrointestinal, hepato, regenerative and vascular toxicity. Small-scale screens have used zebrafish embryos to analyze heart rate and ERG function, and to screen drugs that affect these parameters. Novel tissue-specific and xenobiotic-responsive reporter lines are enabling rapid screening of new chemistries for cardio, hepato, and neuronal toxicity. In particular, zebrafish screens that combine gene expression profiling with comprehensive phenotype analyses are strengthening the predictivity of the toxicology data and fostering greater use of the model, especially as a means of frontloading hazard detection and reducing late-stage attrition in drug discovery. A pressing need remains for large-scale zebrafish studies that systematically evaluate the most promising zebrafish assays against the widest possible range of positive and negative reference compounds to distinguish the truly predictive approaches in zebrafish from those that are not.",
"bookTitle": "New Horizons in Predictive Toxicology",
"extra": "DOI: 10.1039/9781849733045-00330",
"language": "en",
"libraryCatalog": "pubs.rsc.org",
"pages": "330-355",
"shortTitle": "Chapter 14",
"url": "http://pubs.rsc.org/en/content/chapter/bk9781849730518-00330/978-1-84973-051-8",
"attachments": [
{
"title": "Full Text PDF",
@@ -212,23 +223,17 @@ var testCases = [
"title": "Snapshot"
}
],
"title": "Chapter 14 In Vivo Approaches to Predictive Toxicology Using Zebrafish",
"DOI": "10.1039/9781849733045-00330",
"language": "en",
"date": "2011/11/15",
"abstractNote": "A key to sustainability in modern paradigms of drug discovery and toxicology will be predictive structure–activity relationships based on vertebrate-model responses. The zebrafish embryo is the emerging vertebrate choice for rapid-throughput chemical screening, providing a quick and inexpensive way to test hypotheses and to generate strategies for complementary integrative research with rodent models, and humans. Numerous embryonic zebrafish assays and omics approaches appear to predict hazard in mammals. We review physiologic parameters of the zebrafish that are amenable to rapid-throughput screening. Toxicity investigations in the zebrafish have included endpoints in developmental, neuro, cardio, ocular, otic, gastrointestinal, hepato, regenerative and vascular toxicity. Small-scale screens have used zebrafish embryos to analyze heart rate and ERG function, and to screen drugs that affect these parameters. Novel tissue-specific and xenobiotic-responsive reporter lines are enabling rapid screening of new chemistries for cardio, hepato, and neuronal toxicity. In particular, zebrafish screens that combine gene expression profiling with comprehensive phenotype analyses are strengthening the predictivity of the toxicology data and fostering greater use of the model, especially as a means of frontloading hazard detection and reducing late-stage attrition in drug discovery. A pressing need remains for large-scale zebrafish studies that systematically evaluate the most promising zebrafish assays against the widest possible range of positive and negative reference compounds to distinguish the truly predictive approaches in zebrafish from those that are not.",
"url": "http://pubs.rsc.org/en/content/chapter/bk9781849730518-00330/978-1-84973-051-8",
"libraryCatalog": "pubs.rsc.org",
"accessDate": "CURRENT_TIMESTAMP",
"bookTitle": "New Horizons in Predictive Toxicology: Current Status and Application"
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://pubs.rsc.org/en/results?searchtext=open%20source",
"items": "multiple",
"defer": true
"defer": true,
"items": "multiple"
}
]
/** END TEST CASES **/
/** END TEST CASES **/
@@ -221,7 +221,7 @@ var testCases = [
"creatorType": "author"
}
],
"date": "2016/08/20",
"date": "2017/02/02",
"abstractNote": "estout produces a table of regression results from one or several models for use with spreadsheets, LaTeX, HTML, or a word-processor table. eststo stores a quick copy of the active estimation results for later tabulation. esttab is a wrapper for estout. It displays a pretty looking publication-style regression table without much typing. estadd adds additional results to the e()-returns for one or several models previously fitted and stored. This package subsumes the previously circulated esto, esta, estadd, and estadd_plus. An earlier version of estout is available as estout1.",
"libraryCatalog": "RePEc - Econpapers",
"seriesTitle": "Statistical Software Components",
Oops, something went wrong.

0 comments on commit 95103c6

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