From a07240123175ce399d8b685910d83523daf88f12 Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Wed, 12 Dec 2018 23:07:35 -0500 Subject: Add telegram score --- src/html/snake.html | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/html/snake.html') 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")); } -- cgit v1.2.3