//besides deciding whether it is a single item or multiple items
@@ -54,17 +56,13 @@ function detectWeb(doc, url) {
}
functionselectFrame(doc, url) {
if (url.indexOf("target=results_listview_resultsNav") ==-1 ) {
var frames =doc.getElementsByTagName("frame");
var gotoUrl;
for (var i=0; i<frames.length; i++) {
Z.debug("selectFrame: "+ frames[i].src);
if (frames[i].src.indexOf("target=results_listview_resultsNav") !=-1) gotoUrl=frames[i].src;
}
ZU.processDocuments(gotoUrl, scrape);
} else {
scrape(doc,url);
var frames =doc.getElementsByTagName("frame");
var gotoUrl;
for (var i=0; i<frames.length; i++) {
Z.debug("selectFrame: "+ frames[i].src);
if (frames[i].src.indexOf("target=results_listview_resultsNav") !=-1) gotoUrl=frames[i].src;
}
ZU.processDocuments(gotoUrl, scrape);
}
functionscrape(doc, url) {
@@ -87,9 +85,9 @@ function scrape(doc, url) {
var urlIntermediateSite = base+"results/listview/delPrep.do?cisb="+encodeURIComponent(cisb)+"&risb="+encodeURIComponent(risb)+"&mode=delivery_refworks";
var hiddenInputs =ZU.xpath(doc, '//form[@name="results_docview_DocumentForm"]//input[@type="hidden" and not(@name="tagData")]');
if (hiddenInputs.length==0) {
hiddenInputs =ZU.xpath(doc, '//input[@type="hidden" and not(@name="tagData")]');
}
//if (hiddenInputs.length==0) {
// hiddenInputs = ZU.xpath(doc, '//input[@type="hidden" and not(@name="tagData")]');
text =text.replace(/^TY\s+-\s+GEN\s*$/mg, 'TY - NEWS');
//the title information is sometimes somewhere else
if ( text.search(/^TI\s+-/m) ==-1) {
if ( text.search(/^N2\s+-/m) !=-1 ) {
if ( text.search(/^N2\s+-/m) !=-1 ) {//see e.g. Test Case 5
text =text.replace(/^N2\s+-/m,"TI -");
text =text.replace(/^TY\s+-\s+NEWS\s*$/mg, 'TY - JOUR');
} elseif ( text.search(/^U3\s+-/m) !=-1 ) {
} elseif ( text.search(/^U3\s+-/m) !=-1 ) {//see e.g. Test Case 4
text =text.replace(/^U3\s+-/m,"TI -");
text =text.replace(/^TY\s+-\s+NEWS\s*$/mg, 'TY - CASE');
}
}
//most authors are saved in N1 tag, correct that:
text =text.replace(/^N1\s+-[ \f\r\t\v\u00A0\u2028\u2029]+(\w.*)$/mg, cleanAuthorFields );//the range in the regexp is actually just \s without the line break
//correct date format in RIS e.g. PY - 2013/05/09/
text =text.replace(/^PY\s+-\s+(\d\d\d\d)\/(\d\d)\/(\d\d)\//mg, "DA - $1-$2-$3");
text =text.replace(/^PY\s+-\//mg, "DA -");
//correct page information, e.g. SP - WORLD; Pg. 8
text =text.replace(/^SP\s+-\s+(\w.*)$/mg, function(totalMatch, pageString){
var pageAbbreviations = ["Pg.", "S.", "Pag.", "Blz.", "Pág."];
var pageAbbreviations = ["Pg.", "S.", "Pag.", "Blz.", "Pág."];
var pageArray =pageString.split(";");
var pageArray2 =ZU.trimInternal(pageArray[pageArray.length-1]).split("");
if (pageAbbreviations.indexOf(pageArray2[0]) >-1) {
if (pageArray2.length==2&&pageAbbreviations.indexOf(pageArray2[0]) >-1) {//see e.g. Test Cases 1,2,3
"note":"TY - GEN\r\nT1 - Zweifel an Hoeneß' Angaben zur Quelle der Schweizer Millionen; Opposition: Offene Fragen. Koalition erschwert Straffreiheit\r\nJO - Berliner Zeitung\r\nPY - 2014/03/17/\r\nSP - POL; S. 5\r\nM3 - 479 Wörter\r\nN1 - Steven Geyer\r\nER -\r\n"
}
],
"tags": [],
"seeAlso": [],
"attachments": [
{
"title":"LexisNexis Entry",
"mimeType":"text/html"
}
],
"title":"Zweifel an Hoeneß' Angaben zur Quelle der Schweizer Millionen; Opposition: Offene Fragen. Koalition erschwert Straffreiheit",
"note":"TY - GEN\r\nT1 - Hijack fear as al-Qaeda plot revealed Plane systems turned off by someone aboard; FLIGHT MH370\r\nJO - The Age (Melbourne, Australia)\r\nPY - 2014/03/17/\r\nSP - NEWS; Pg. 6\r\nM3 - 1219 words\r\nN1 - Paul Bibby, Lindsay Murdoch, Jason Koutsoukis, Tom Allard\r\nER -\r\n"
}
],
"tags": [],
"seeAlso": [],
"attachments": [
{
"title":"LexisNexis Entry",
"mimeType":"text/html"
}
],
"title":"Hijack fear as al-Qaeda plot revealed Plane systems turned off by someone aboard; FLIGHT MH370",
"journalAbbreviation":"The Age (Melbourne, Australia)",
"date":"2014-03-17",
"pages":"6",
"section":"NEWS",
"publicationTitle":"The Age (Melbourne, Australia)",
"note":"TY - GEN\r\nU3 - Ricci v. DeStefano, \r\nM2 - (No. 07-1428), (No. 08-328)\r\nPB - SUPREME COURT OF THE UNITED STATES\r\nM2 - 557 U.S. 557; 129 S. Ct. 2658; 174 L. Ed. 2d 490; 2009 U.S. LEXIS 4945; 77 U.S.L.W. 4639; 106 Fair Empl. Prac. Cas. (BNA) 929; 92 Empl. Prac. Dec. (CCH) P43,602; 21 Fla. L. Weekly Fed. S 1049\r\nU2 - The LEXIS pagination of this document is subject to change pending release of the final published version.\r\nU1 - Related proceeding at Luschenat v. City of New Haven, 2013 U.S. Dist. LEXIS 15929 (D. Conn., Feb. 6, 2013)\r\nER -\r\n"
}
],
"tags": [],
"seeAlso": [],
"attachments": [
{
"title":"LexisNexis Entry",
"mimeType":"text/html"
}
],
"caseName":"Ricci v. DeStefano,",
"extra":"(No. 07-1428), (No. 08-328); 557 U.S. 557; 129 S. Ct. 2658; 174 L. Ed. 2d 490; 2009 U.S. LEXIS 4945; 77 U.S.L.W. 4639; 106 Fair Empl. Prac. Cas. (BNA) 929; 92 Empl. Prac. Dec. (CCH) P43,602; 21 Fla. L. Weekly Fed. S 1049",
"note":"TY - GEN\r\nPB - Copyright (c) 2013 The American Society of International Law American Journal of International Law\r\nPY - 2013/07/01/\r\nM2 - 107 A.J.I.L. 684\r\nM3 - 1167 words\r\nN2 - CONTEMPORARY PRACTICE OF THE UNITED STATES RELATING TO INTERNATIONAL LAW: SETTLEMENT OF DISPUTES: Guatemala and United States CAFTA-DR Labor Standards Arbitration Suspended\r\nU3 - EDITED BY JOHN R. CROOK\r\nER -\r\n"
}
],
"tags": [],
"seeAlso": [],
"attachments": [
{
"title":"LexisNexis Entry",
"mimeType":"text/html"
}
],
"publisher":"Copyright (c) 2013 The American Society of International Law American Journal of International Law",
"date":"2013-07-01",
"extra":"107 A.J.I.L. 684",
"title":"CONTEMPORARY PRACTICE OF THE UNITED STATES RELATING TO INTERNATIONAL LAW: SETTLEMENT OF DISPUTES: Guatemala and United States CAFTA-DR Labor Standards Arbitration Suspended",
"note":"TY - GEN\r\nT1 - Smartphones steuern fast alles; MESSE Auf dem Mobile World Congress bestimmt Vernetzungstrend das Geschehen\r\nJO - Bürstädter Zeitung (Germany)\r\nPY - 2014/03/11/\r\nSP - MULTIMEDIA\r\nM3 - 587 Wörter\r\nER -\r\n"
}
],
"tags": [],
"seeAlso": [],
"attachments": [
{
"title":"LexisNexis Entry",
"mimeType":"text/html"
}
],
"title":"Smartphones steuern fast alles; MESSE Auf dem Mobile World Congress bestimmt Vernetzungstrend das Geschehen",
0 comments on commit
fd1fb14