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 3 made on Saturday June 6, 2020 at 00:39
kapsreiter
Long Time Member
Joined:
Posts:
November 2006
48
thank ou


this is the complete working code

tom



var result = "";
var socket = new TCPSocket(false);
var t1,t2,t3,t4,t5;
var event1,event2;
var descrip1, descrip2;

socket.onConnect = function()
{
socket.write("GET /relay/0?turn=toggle HTTP/1.0\r\n");
socket.write("Accept: */*\r\n");
socket.write("Host: 10.0.0.13\r\n");
socket.write("Connection: close\r\n");
socket.write("\r\n");
};
socket.onData = function()
{
//result += socket.read(5000,1000);

t0 = result.indexOf("class=\"time\">", 0)+13;
t10 = result.indexOf("/span>",t0)-1;
tijd1 = result.substring(t0,t10);

t1 = result.indexOf("class=\"event\">", 0)+14;
t2 = result.indexOf("/span>",t1)-1;
event1 = result.substring(t1,t2);
CF.widget("channel1").label=event1;

t4 = result.indexOf("class=\"description\">", t2)+20;
t5 = result.indexOf("/span>",t4)-1;

t6 = result.indexOf("class=\"event\">", t5)+14;
t7 = result.indexOf("/span>",t6)-1;
event2 = result.substring(t6,t7);
CF.widget("channel2").label=event2;

};


socket.onClose = function()
{
};


socket.onIOError = function(e)
{
};


if(socket.connected == false)
{
socket.connect('10.0.0.13', 80, 3000);
};


Hosting Services by ipHouse