Last active
May 21, 2020 11:51
-
-
Save mykola-den/ab3cebec2f6357846fa079ae5f573357 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var encodedCommand = "96 D9 24 31 38 33 33 65 61 36 38 2D 64 36 34 38 2D 34 61 38 65 2D 39 61 30 64 2D 64 30 38 30 61 63 32 32 30 65 34 30 00 01 00 A2 65 6E C4 14 92 B1 24 66 69 6C 74 65 72 3D 69 64 20 6E 65 20 27 30 27 C0" | |
| var binCommand = new Uint8Array(encodedCommand.replace(' ','').match(/[\da-f]{2}/gi).map(function (h) { | |
| return parseInt(h, 16) | |
| })) | |
| var sock = new WebSocket('ws://localhost:5005/api/sportsdata/v2'); | |
| sock.onopen = ()=>{ sock.send(binCommand) } | |
| sock.onmessage=( msg )=>{ | |
| MessagePack.decodeAsync(msg.data.stream()).then(envelope=>{ | |
| console.log(MessagePack.decode(envelope[6])) | |
| })} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment