Commit 192f4c7f authored by Sini's avatar Sini
Browse files

Update using the Recent ExcelSheet

parent bc34e13e
Pipeline #3321 passed with stage
in 24 seconds
...@@ -9,7 +9,7 @@ var bit1stAuthorLN =""; ...@@ -9,7 +9,7 @@ var bit1stAuthorLN ="";
/* set up XMLHttpRequest */ /* set up XMLHttpRequest */
var url = "./content/CitationSheet.xlsx"; var url = "./content/CitationSheet3.xlsx";
var xmlHttpRequest = new XMLHttpRequest(); var xmlHttpRequest = new XMLHttpRequest();
xmlHttpRequest.open("GET", url, true); xmlHttpRequest.open("GET", url, true);
xmlHttpRequest.responseType = "arraybuffer"; xmlHttpRequest.responseType = "arraybuffer";
...@@ -33,9 +33,13 @@ xmlHttpRequest.onload = function (e) { ...@@ -33,9 +33,13 @@ xmlHttpRequest.onload = function (e) {
var worksheet = workbook.Sheets[first_sheet_name]; var worksheet = workbook.Sheets[first_sheet_name];
var jsonOutput = XLSX.utils.sheet_to_json(worksheet); var jsonOutput = XLSX.utils.sheet_to_json(worksheet);
// console.log(jsonOutput);
for (i = 0; i < jsonOutput.length; i++) { for (i = 0; i < jsonOutput.length; i++) {
var authors = jsonOutput[i].Authors.replace("and ", "").trim().split(","); var authors;
if (jsonOutput[i].Authors != undefined){
authors = jsonOutput[i].Authors.replace("and ", "").trim().split(",");
}
var bibAuthors; var bibAuthors;
var item = { var item = {
"item": { "item": {
...@@ -48,9 +52,21 @@ xmlHttpRequest.onload = function (e) { ...@@ -48,9 +52,21 @@ xmlHttpRequest.onload = function (e) {
"name": "journal", "name": "journal",
"volume": "", "volume": "",
"year": "", "year": "",
"month": "",
"pages": "" "pages": ""
}, },
"DOI": "" "conference":{
"name":"",
"place":"",
"date":""
},
"DOI": "",
"publisher":"",
"type":"",
"project":"",
"reviewed":"",
"open":""
}, },
"links": { "links": {
"pdf": "", "pdf": "",
...@@ -107,11 +123,24 @@ xmlHttpRequest.onload = function (e) { ...@@ -107,11 +123,24 @@ xmlHttpRequest.onload = function (e) {
item["item"].journal.name = jsonOutput[i].Journal; item["item"].journal.name = jsonOutput[i].Journal;
item["item"].journal.volume = jsonOutput[i].Volume; item["item"].journal.volume = jsonOutput[i].Volume;
item["item"].journal.year = jsonOutput[i].Year; item["item"].journal.year = jsonOutput[i].Year;
if (jsonOutput[i].Date != undefined){
item["item"].journal.month = jsonOutput[i].Date.split(",")[0].trim();
}
item["item"].journal.pages = jsonOutput[i].Pages; item["item"].journal.pages = jsonOutput[i].Pages;
item["item"].conference.name = jsonOutput[i].Conference;
item["item"].conference.place = jsonOutput[i]["City and Country"]
item["item"].conference.date = jsonOutput[i].Date;
item["item"].publisher = jsonOutput[i].Publisher;
item["item"].type = jsonOutput[i]["Type of Work"];
item["item"].project = jsonOutput[i].Project;
item["item"].reviewed = jsonOutput[i]["Peer-Reviewed"];
item["item"].open = jsonOutput[i]["Open Access"];
item["item"].DOI = jsonOutput[i].DOI; item["item"].DOI = jsonOutput[i].DOI;
item["links"].pdf = jsonOutput[i].URL; item["links"].pdf = jsonOutput[i].PDF_Link;
item["links"].url = jsonOutput[i].URL; item["links"].url = jsonOutput[i].URL;
item["links"].demo = jsonOutput[i].URL; item["links"].demo = jsonOutput[i].Demo;
//// BibTex ///////////////////// //// BibTex /////////////////////
item["bibtex"] = "@article{"+ bit1stAuthorLN + jsonOutput[i].Year +","+ item["bibtex"] = "@article{"+ bit1stAuthorLN + jsonOutput[i].Year +","+
...@@ -119,7 +148,7 @@ xmlHttpRequest.onload = function (e) { ...@@ -119,7 +148,7 @@ xmlHttpRequest.onload = function (e) {
"},author={"+ bibAuthors.trim().substring(0, bibAuthors.trim().lastIndexOf(" ")) + "},author={"+ bibAuthors.trim().substring(0, bibAuthors.trim().lastIndexOf(" ")) +
"},journal={"+ jsonOutput[i].Journal + "},journal={"+ jsonOutput[i].Journal +
"},volume={"+ jsonOutput[i].Volume + "},volume={"+ jsonOutput[i].Volume +
// "},number={"+ number // "},number={"+ jsonOutput[i].Number
"},pages={"+ jsonOutput[i].Pages + "},pages={"+ jsonOutput[i].Pages +
"},year={"+ jsonOutput[i].Year + "},year={"+ jsonOutput[i].Year +
"},DOI ={"+ jsonOutput[i].DOI+ "},DOI ={"+ jsonOutput[i].DOI+
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment