code: function updateViewerData(data) {
    console.log("updating data")
    var bindings = {
      connected: { selector: "#countConnected", data: 0 },
      desktop: { selector: "#countDesktop", data: 0 },
      mobile: { selector: "#countMobile", data: 0 },
      android: { selector: "#countAndroid", data: 0 },
      ios: { selector: "#countIOS", data: 0 },
      other: { selector: "#countOther", data: 0 }
    }
  
    bindings.connected.data = data.clients
  
    var stats = getUAStats(data.userAgents)
  
    Object.keys(stats).forEach(function(key) {
      bindings[key].data = stats[key]
    })
  
    Object.keys(bindings).forEach(function(key) {
      var binding = bindings[key]
      document.querySelector(binding.selector).innerText = binding.data
    })
  }
docs: window.addEventListener('DOMContentLoaded', onDCL);