Post 1 made on Saturday August 1, 2020 at 12:20 |
mpg7321 Regular Member |
Joined: Posts: | June 2020 111 |
|
|
So this is my first attempt working on feedback and not having luck yet. So was wondering if I have the logic down. So in the below script, when I send the command to retrieve whats playing, the returned data should be put into the variable "info" because of this line "info = socket.read(100, 3000);", Correct? If so then shouldn't the data then be displayed in a panel with the Pronto Script name: "KODI_INFO". So far I have had no luck.
var url = CF.widget("Kodi_aURL","Kodi_PARAMETERS_test").label; var info;
function kodi(command) { var socket = new TCPSocket(); socket.onConnect = function() { prefix = 'GET /jsonrpc?request=' postfix = ' HTTP/1.0\r\n"' try { socket.write(prefix+command+postfix); socket.write("HOST:+url+\r\n\r\n"); info = socket.read(100, 3000); CF.widget("KODI_INFO").label=info; } catch(e) { socket.close() }} socket.onData = function() { socket.close() } socket.onIOError = function(e) { socket.close() } socket.connect(url, 9090, 300); };
|
|
|