Date | Opponent | Competition |
---|
Date | Result | Opponent |
---|
<script data-cfasync="false"><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> document.addEventListener("DOMContentLoaded", function(event) {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> fetchData('Competition_Master_Calendar');<!-- [et_pb_line_break_holder] --> fetchData('Results_Latest');<!-- [et_pb_line_break_holder] --> });<!-- [et_pb_line_break_holder] --> function appendData(data, target) {<!-- [et_pb_line_break_holder] --> if (target === 'competition_master_calendar') { //this is probably not needed seeing that we'll only use this worksheet(But still experimenting)<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> for (var idx = 0; idx < data.length; idx++) {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> var tr = document.createElement("TR");<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> var td1 = document.createElement("TD");//Date<!-- [et_pb_line_break_holder] --> var td2 = document.createElement("TD");//Opponent<!-- [et_pb_line_break_holder] --> var td3 = document.createElement("TD");//Competition abbrev<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> console.log(data[idx].date);<!-- [et_pb_line_break_holder] --> if (data[idx].team == "Men's U/20") {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> var td1Txt = document.createTextNode(data[idx].date); // get the date<!-- [et_pb_line_break_holder] --> var td2Txt = document.createTextNode(data[idx].opponent); //get the Opponent of that team<!-- [et_pb_line_break_holder] --> var td3Txt = document.createTextNode(data[idx].competition_abbreviation);<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> var createA = document.createElement('a');<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> createA.setAttribute('href', data[idx].team_url);<!-- [et_pb_line_break_holder] --> createA.appendChild(td3Txt);<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> td1.appendChild(td1Txt);<!-- [et_pb_line_break_holder] --> td2.appendChild(td2Txt);<!-- [et_pb_line_break_holder] --> td3.appendChild(createA);<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> tr.appendChild(td1);<!-- [et_pb_line_break_holder] --> tr.appendChild(td2);<!-- [et_pb_line_break_holder] --> tr.appendChild(td3);<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> document.getElementById(target).appendChild(tr);<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> else {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> for (var idx = 0; idx < data.length; idx++) {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> var tr = document.createElement("TR");<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> var td1 = document.createElement("TD");//Date<!-- [et_pb_line_break_holder] --> var td2 = document.createElement("TD");//Opponent<!-- [et_pb_line_break_holder] --> var td3 = document.createElement("TD");//Competition abbrev<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> console.log(data[idx].date);<!-- [et_pb_line_break_holder] --> if (data[idx].team == "Men's U/20") {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> var td1Txt = document.createTextNode(data[idx].date); // get the date<!-- [et_pb_line_break_holder] --> var td2Txt = document.createTextNode(data[idx].result + ' ' + data[idx].rsa_goals + '-' + data[idx].opponent_goals); //get the Opponent of that team<!-- [et_pb_line_break_holder] --> var td3Txt = document.createTextNode(data[idx].opponent);<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> td1.appendChild(td1Txt);<!-- [et_pb_line_break_holder] --> td2.appendChild(td2Txt);<!-- [et_pb_line_break_holder] --> td3.appendChild(td3Txt);<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> tr.appendChild(td1);<!-- [et_pb_line_break_holder] --> tr.appendChild(td2);<!-- [et_pb_line_break_holder] --> tr.appendChild(td3);<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> document.getElementById(target).appendChild(tr);<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> function fetchData(replaceString) {<!-- [et_pb_line_break_holder] --> //Sheet ID for the inqaku data<!-- [et_pb_line_break_holder] --> var spreadsheetID = "1qQrW6ne8Z6GLHKPKmVdw05kydr-XD8SSekFtFF0FILk&";<!-- [et_pb_line_break_holder] --> var url = 'https://script.google.com/macros/s/AKfycbyc8hHv3PSMCOU5Bz8aOLEhUIbfkAS575ncRM_-FYVwS_piBnc/exec?id=..SheetID..sheet=..Sheet..';<!-- [et_pb_line_break_holder] --> url = url.replace('..SheetID..', spreadsheetID.replace('#038;', '')).replace('..Sheet..', replaceString);<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> var xhttp = new XMLHttpRequest();<!-- [et_pb_line_break_holder] --> xhttp.onreadystatechange = function () {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> if (this.readyState == 4) {<!-- [et_pb_line_break_holder] --> if (this.status == 200) {<!-- [et_pb_line_break_holder] --> // Typical action to be performed when the document is ready:<!-- [et_pb_line_break_holder] --> var jsonObj = JSON.parse(xhttp.responseText);<!-- [et_pb_line_break_holder] --> appendData(jsonObj, replaceString.toLowerCase());<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> };<!-- [et_pb_line_break_holder] --> xhttp.open("GET", url, true);<!-- [et_pb_line_break_holder] --> xhttp.send();<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --></script>