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

Update using the Recent ExcelSheet

parent bc34e13e
......@@ -9,7 +9,7 @@ var bit1stAuthorLN ="";
/* set up XMLHttpRequest */
var url = "./content/CitationSheet.xlsx";
var url = "./content/CitationSheet3.xlsx";
var xmlHttpRequest = new XMLHttpRequest();
xmlHttpRequest.open("GET", url, true);
xmlHttpRequest.responseType = "arraybuffer";
......@@ -33,9 +33,13 @@ xmlHttpRequest.onload = function (e) {
var worksheet = workbook.Sheets[first_sheet_name];
var jsonOutput = XLSX.utils.sheet_to_json(worksheet);
// console.log(jsonOutput);
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 item = {
"item": {
......@@ -48,9 +52,21 @@ xmlHttpRequest.onload = function (e) {
"name": "journal",
"volume": "",
"year": "",
"month": "",
"pages": ""
},
"DOI": ""
"conference":{
"name":"",
"place":"",
"date":""
},
"DOI": "",
"publisher":"",
"type":"",
"project":"",
"reviewed":"",
"open":""
},
"links": {
"pdf": "",
......@@ -107,11 +123,24 @@ xmlHttpRequest.onload = function (e) {
item["item"].journal.name = jsonOutput[i].Journal;
item["item"].journal.volume = jsonOutput[i].Volume;
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"].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["links"].pdf = jsonOutput[i].URL;
item["links"].pdf = jsonOutput[i].PDF_Link;
item["links"].url = jsonOutput[i].URL;
item["links"].demo = jsonOutput[i].URL;
item["links"].demo = jsonOutput[i].Demo;
//// BibTex /////////////////////
item["bibtex"] = "@article{"+ bit1stAuthorLN + jsonOutput[i].Year +","+
......@@ -119,7 +148,7 @@ xmlHttpRequest.onload = function (e) {
"},author={"+ bibAuthors.trim().substring(0, bibAuthors.trim().lastIndexOf(" ")) +
"},journal={"+ jsonOutput[i].Journal +
"},volume={"+ jsonOutput[i].Volume +
// "},number={"+ number
// "},number={"+ jsonOutput[i].Number
"},pages={"+ jsonOutput[i].Pages +
"},year={"+ jsonOutput[i].Year +
"},DOI ={"+ jsonOutput[i].DOI+
......
Markdown is supported
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