Trans: In EBSCO, fix all items showing up as journal articles, also DOI parsing http://forums.zotero.org/discussion/15024
This commit is contained in:
parent
dd5942c538
commit
012e127a7e
1 changed files with 7 additions and 14 deletions
|
@ -16,9 +16,6 @@ function detectWeb(doc, url) {
|
||||||
var nsResolver = namespace ? function(prefix) {
|
var nsResolver = namespace ? function(prefix) {
|
||||||
if (prefix == 'x') return namespace; else return null;
|
if (prefix == 'x') return namespace; else return null;
|
||||||
} : null;
|
} : null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// The Scientific American Archive breaks this translator, disabling
|
// The Scientific American Archive breaks this translator, disabling
|
||||||
try {
|
try {
|
||||||
var databases = doc.evaluate("//span[@class = 'selected-databases']", doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent;
|
var databases = doc.evaluate("//span[@class = 'selected-databases']", doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent;
|
||||||
|
@ -50,10 +47,6 @@ function detectWeb(doc, url) {
|
||||||
+' or starts-with(text(), "Bu kayda sürekli bağlantı")'
|
+' or starts-with(text(), "Bu kayda sürekli bağlantı")'
|
||||||
+' or starts-with(text(), "Μόνιμος σύνδεσμος σε αυτό το αρχείο")]';
|
+' or starts-with(text(), "Μόνιμος σύνδεσμος σε αυτό το αρχείο")]';
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var xpath = '//input[@id="ctl00_ctl00_Column2_Column2_topDeliveryControl_deliveryButtonControl_lnkExport"]';
|
var xpath = '//input[@id="ctl00_ctl00_Column2_Column2_topDeliveryControl_deliveryButtonControl_lnkExport"]';
|
||||||
var persistentLink = doc.evaluate(xpath, doc, nsResolver, XPathResult.ANY_TYPE, null);
|
var persistentLink = doc.evaluate(xpath, doc, nsResolver, XPathResult.ANY_TYPE, null);
|
||||||
if(persistentLink) {
|
if(persistentLink) {
|
||||||
|
@ -112,16 +105,16 @@ function downloadFunction(text) {
|
||||||
translator.setTranslator("32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7");
|
translator.setTranslator("32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7");
|
||||||
translator.setString(text);
|
translator.setString(text);
|
||||||
translator.setHandler("itemDone", function(obj, item) {
|
translator.setHandler("itemDone", function(obj, item) {
|
||||||
if (text.match("L3")) {
|
if (text.match(/^L3\s+-\s*(.*)/m)) {
|
||||||
item.DOI = text.match(/L3\s+\-\s*(.*)/)[1];
|
item.DOI = text.match(/^L3\s+\-\s*(.*)/m)[1];
|
||||||
}
|
}
|
||||||
if (text.match("DO")) {
|
if (text.match(/^DO\s+-\s*(.*)/m)) {
|
||||||
item.DOI = text.match(/DO\s+\-\s*(.*)/)[1];
|
item.DOI = text.match(/^DO\s+-\s*(.*)/m)[1];
|
||||||
}
|
}
|
||||||
if (text.match("T1")) {
|
if (text.match(/^T1\s+-/m)) {
|
||||||
item.title = text.match(/T1\s+-\s*(.*)/)[1];
|
item.title = text.match(/^T1\s+-\s*(.*)/m)[1];
|
||||||
}
|
}
|
||||||
item.itemType = "journalArticle";
|
//item.itemType = "journalArticle";
|
||||||
item.url = false;
|
item.url = false;
|
||||||
// RIS translator tries to download the link in "UR" this leads to unhappyness
|
// RIS translator tries to download the link in "UR" this leads to unhappyness
|
||||||
item.attachments = [];
|
item.attachments = [];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue