-
Notifications
You must be signed in to change notification settings - Fork 1
/
dummy.html
30 lines (28 loc) · 1.45 KB
/
dummy.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<html>
<body>
<button name="plant" onclick="plant();">Plant the bomb</button>
<button name="defuse" onclick="defuse();">Defuse the bomb</button>
<button name="roundover" onclick="roundover();">Last CT dies while bomb still ticking</button>
<script>
function sendPost(data)
{
var xhttp = new XMLHttpRequest();
xhttp.open("POST", "http://127.0.0.1:3000", true);
xhttp.setRequestHeader("Content-type", "application/json");
xhttp.send(data);
}
function plant() {
var payload = '{ "provider": { "name": "Counter-Strike: Global Offensive", "appid": 730, "version": 13631, "steamid": "", "timestamp": 1524066980 }, "round": { "phase": "live", "bomb": "planted" }, "added": { "round": { "bomb": true } } }';
sendPost(payload);
}
function defuse() {
var payload = '{ "provider": { "name": "Counter-Strike: Global Offensive", "appid": 730, "version": 13631, "steamid": "", "timestamp": 1524067126 }, "round": { "phase": "over", "win_team": "CT", "bomb": "defused" }, "previously": { "round": { "phase": "live", "bomb": "planted" } }, "added": { "round": { "win_team": true } } }';
sendPost(payload);
}
function roundover() {
var payload = '{ "provider": { "name": "Counter-Strike: Global Offensive", "appid": 730, "version": 13631, "steamid": "", "timestamp": 1524067201 }, "round": { "phase": "over", "win_team": "T" }, "previously": { "round": { "phase": "live", "bomb": "planted" } }, "added": { "round": { "win_team": true } } }';
sendPost(payload);
}
</script>
</body>
</html>