Skip to content

Instantly share code, notes, and snippets.

@stu43005
Created October 26, 2018 13:01
Show Gist options
  • Save stu43005/9d44f9e4ce5d8d06258bb76bc989692c to your computer and use it in GitHub Desktop.
Save stu43005/9d44f9e4ce5d8d06258bb76bc989692c to your computer and use it in GitHub Desktop.
https://www.sdoricaxdeemo.rayark.games/ Sdorica X DEEMO 特設網頁,查看進度%數及更新時間
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Sdorica X DEEMO</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<iframe src="https://www.sdoricaxdeemo.rayark.games/" frameborder="0" width="100%" height="800px"></iframe>
<span id="value"></span>% - <span id="update"></span>
<script>
function initialize(value, update) {
document.getElementById("value").innerText = value;
document.getElementById("update").innerText = (new Date(update)).toString();
}
function doData(json) {
var spData = json.feed.entry;
if (spData != null) {
for (var r = 0; r < spData.length; r++) {
if (spData[r]['content']['$t'] != "undefined") {
var cellValue = spData[r]['content']['$t'];
cellValue = String(cellValue.replace(/[^0-9.-]/g, ''));
cellValue = spData[r]['content']['$t'];
var update = spData[r]['updated']['$t'];
initialize(cellValue, update);
}
}
}
}
</script>
<script src="https://spreadsheets.google.com/feeds/cells/1KDPFC4dqg_9w0nzyrv14iGVkUG2_ByG17BIOpytxm6M/1/public/values?alt=json-in-script&callback=doData&range=A1"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment