I've created my first web app (it's now kinda a web page) with the google script api.
From this experience I thought "wow getting the data is easy".
urlFetchApp.fetch()
Collating the data was not so easy, but not too bad. Lots of loops etc.
However creating my "table" for output was horrendous.
// Blue team Output
output = "<table class='gradienttable' width = '60%'><tr><th>Blue Team</th>"
for (p in players) {
if (players[p].team != 100) {
output = output + "<th width = '14%'>" + players[p].pname + "<br>(" + players[p].cname + ")</th>";}
}
for (p in players) {
//output = output + "<tr>";
i = 1;
for (k in players){
if (players[p].team == 100) {
if (i==1) { output = output + "<tr><th width = '14%'>" + players[p].pname + "<br>(" + players[p].cname + " " +players[p].kda +")</th>"; }
if (players[k].team != players[p].team) {
output = output + "<td>" + players[p].killed[k] + "</td>";}
i++;
}
}
output = output + "</tr>";
}
output = output + "</table>";
return output;
Is there's no JSON.htmltablify(myobject)
or something easy like that?