Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 9 made on Sunday August 2, 2020 at 00:18
mpg7321
Regular Member
Joined:
Posts:
June 2020
111
so got this to work,

var url = CF.widget("Kodi_aURL","Kodi_PARAMETERS_test").label;
var info;
function kodi() {
var socket = new TCPSocket();
socket.onConnect = function() {
prefix = 'GET /jsonrpc?request={"jsonrpc": "2.0", "method": "Player.GetItem", "params": { "properties": ["title"], "playerid": 1 }, "id": "1"}'
postfix = ' HTTP/1.0\r\n'
try {
socket.write(prefix+postfix);
socket.write("HOST:+url+\r\n\r\n");
} catch(e) {
socket.close()
}}
socket.onData = function() {
info = socket.read();
var title = info.split('title":"').pop().split('","type')[0];
CF.widget("KODI_INFO").label=title;
socket.close()
}
socket.onIOError = function(e) {
socket.close()
}
socket.connect(url, 9090, 3000);
};


but not this, and Im not sure why,


var url = CF.widget("Kodi_aURL","Kodi_PARAMETERS_test").label;
var info;
function kodi() {
var socket = new TCPSocket();
socket.onConnect = function() {
try {
socket.write("GET /jsonrpc?request={"jsonrpc": "2.0", "method": "Player.GetItem", "params": { "properties": ["title"], "playerid": 1 }, "id": "1"} HTTP/1.0\r\n");
socket.write("HOST:+url+\r\n\r\n");
} catch(e) {
socket.close()
}}
socket.onData = function() {
info = socket.read();
var title = info.split('title":"').pop().split('","type')[0];
CF.widget("KODI_INFO").label=title;
socket.close()
}
socket.onIOError = function(e) {
socket.close()
}
socket.connect(url, 9090, 3000);
};


Hosting Services by ipHouse