<!DOCTYPE HTML> <html> <head> <title>rhimportd - Testclient</title> <meta charset="utf-8"> <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 Session(req) { this.req = req this.sock = new WebSocket("ws://localhost:4080/public/socket"); this.sock.onmessage = function (event) { $('#rawmsg').text(event.data); } this.sock_onopen = function() { this.req.COMMAND = "new"; this.req.TIMEOUT = 200; this.sock.send(JSON.stringify(this.req)); } this.sock.onopen = this.sock_onopen.bind(this); } var s; function init() { req = { LOGIN_NAME: "heslinki", PASSWORD: "12423", SHOW_ID: 10002, CLEAR_SHOW_CARTS: true, SOURCE_URI: "http://www.tonycuffe.com/mp3/tail%20toddle.mp3" }; s = new Session(req); } </script> </head> <body onload="init()"> <h1>Radio Helsinki Rivendell Importer:</h1> <div id="rawmsg" class="data"></div> </body> </html>