<html>
  <head>
    <title>rhimportd - Testclient</title>
    <style type="text/css">
      body {
        background-color: #555;
      }

      div.data {
        background-color: white;
        border: 1px solid;
        padding: 1em;
        font-family: monospace;
      }
    </style>
    <script src="jquery.min.js"></script>
    <script type="text/javascript">
      function Test() {
        this.sock = new WebSocket("ws://localhost:4080/trusted/socket");
        this.sock.onmessage = function (event) {
          $('#rawmsg').text(event.data);
        }
        this.update = function() {
          this.sock.send(JSON.stringify({ COMMAND: "new" }));
        }
      }

      function init() {
        test = new Test();
        setInterval(test.update.bind(test), 1000);
  //      test.update();
      }
    </script>
  </head>
  <body onload="init()">

    <h1>Radio Helsinki Rivendell Importer:</h1>

    <div id="rawmsg" class="data"></div>

  </body>
</html>