Importing javascript table into Google Docs spreadsheet

守給你的承諾、 提交于 2019-12-04 16:35:06

After looking into this, I think you should take the following approach. It turns out that leaderboard is available as a JSON file. I wrote a function to test out the import and it works well.

function update_leaderboard(){
  var url = "http://www.pgatour.com/data/r/033/leaderboard-v2.json?ts=" + new Date().getTime()
  var result = UrlFetchApp.fetch(url);
  var response = result.getContentText();
  var data = JSON.parse(response);
  var w = SpreadsheetApp.getActive();
  var s = w.getActiveSheet();
  s.clear();
  //Write the JSON to the spreadsheet...
}

Having gotten that far, the only thing left to do is write that information onto the spreadsheet.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!