{"size": 621, "ext": "js", "max_stars_repo_path": "src/public/js/socket.js", "max_stars_repo_name": "JohnDoeInvest/show-me-your-work", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/public/js/socket.js", "max_issues_repo_name": "JohnDoeInvest/show-me-your-work", "max_issues_repo_issues_event_min_datetime": "2019-07-26T07:43:41.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-08T10:27:40.000Z", "max_forks_repo_path": "src/public/js/socket.js", "max_forks_repo_name": "JohnDoeInvest/show-me-your-work", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 21, "max_forks_count": null, "avg_line_length": 36.5294117647, "max_line_length": 97, "alphanum_fraction": 0.694041868}
const hrefNoProtocol = location.origin.replace(location.protocol, '')
const url = location.hostname === 'localhost' ? 'ws://localhost:3000' : 'wss://' + hrefNoProtocol
const ws = new WebSocket(url + '/events')
const domparser = new DOMParser()
ws.addEventListener('message', function (event) {
  const message = JSON.parse(event.data)
  let node
  if (message.event === 'status') {
    node = document.getElementById('status')
  } else if (message.event === 'queue') {
    node = document.getElementById('queue')
  }

  node.innerHTML = ''
  node.appendChild(domparser.parseFromString(message.html, 'text/html').body)
})
