aboutsummaryrefslogtreecommitdiff
path: root/src/html
diff options
context:
space:
mode:
authorMark Powers <markppowers0@gmail.com>2018-12-12 23:07:35 -0500
committerMark Powers <markppowers0@gmail.com>2018-12-12 23:07:35 -0500
commita07240123175ce399d8b685910d83523daf88f12 (patch)
tree8b384c1da5181ed8be543792d877b48a83b8e165 /src/html
parentf2d0e534090be82a71506a9ba9789a08c4add6f0 (diff)
Add telegram score
Diffstat (limited to 'src/html')
-rwxr-xr-xsrc/html/snake.html10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/html/snake.html b/src/html/snake.html
index a05af59..90dc78d 100755
--- a/src/html/snake.html
+++ b/src/html/snake.html
@@ -202,6 +202,16 @@
function gameOver() {
isGameOver = true;
clearInterval(gameInterval);
+
+ const urlParams = new URLSearchParams(window.location.search);
+ const uid = urlParams.get('uid');
+ const mid = urlParams.get('mid');
+ const cid = urlParams.get('cid');
+ console.log(uid, mid, cid);
+
+ const request = new Request(`/setScore?uid=${uid}&cid=${cid}&mid=${mid}&score=${score}`);
+ console.log(request)
+ fetch(request).then(response => console.log("response"));
}
</script>
</body>