Hasil
var APIkey=’!_your_account_APIkey_!’;
var socket = new WebSocket(‘wss://wss.allsportsapi.com/live_events?widgetKey=’+APIkey+’&timezone=+03:00’);
socket.onmessage = function(e) {
if (e.data) {
var matchesData = JSON.parse(e.data);
// Now variable matchesData contains all matches that received an update
// Here can update matches in dom from variable matchesData
console.log(matchesData);
}
}