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

Login:
Pass:
 
 

Topic:
How to display TiVo "Now Playing" list in Pronto?
This thread has 9 replies. Displaying all posts.
Post 1 made on Friday December 21, 2007 at 11:26
randman
Long Time Member
Joined:
Posts:
June 2003
424
From a web browser, it is possible to display the "Now Playing" list of a TiVo via the URL https://TiVoIPAddress. The TiVo's built-in web server will prompt you for a user id and password, which is "tivo" and your Media Access Key, respectively. Then, you get a web page showing all the recordings TiVo has made, a description of each show, the date, and show's duration.

It would be great if the information can be displayed in a TSU9400 or TSU9600, so I wouldn't have to boot up my projector or go to a PC to see what's in my TiVo's "Now Playing" list.

I understand that the TSU9400/9600 don't have built in web browsing capability. Any rumours if this capability will be made available? In lieu of a web browser, does anyone have any tips on how the information can be retrieved from a TiVo using Prontoscript? For example, what APIs to use to communicate to a web server (I assume Prontoscript supports post/get, etc.). Then, would it be a matter of using regular expressions to parse the information from the web server to display it in Pronto?

Last edited by randman on December 21, 2007 12:31.
Post 2 made on Friday December 21, 2007 at 15:27
MVis
Long Time Member
Joined:
Posts:
July 2007
94
Yes, basically you have described the steps. Open the socket, do a get and parse it.

I have done a simple implementation of communication with a Netgear router to get the IP address of attached devices that are presented in HTML. The two hard parts (for me) were figuring out that I needed to use base64 conversion for the username/passwords (believe that's what it is called) and figuring out regular expressions that worked. Snips of sample code for whatever they're worth (ugly, buggy, but working for me).

var result = "";
var resultcount = 0;

socket.onConnect = function()
{
socket.write("GET /DEV_device.htm\r\n");
socket.write("Authorization: Basic usernamepasswordinbase64==\r\n\r\n");
};

socket.onData = function()
{
result += socket.read();
};

socket.onClose = function()
{
GUI.widget("HOSTNAME_1").label = "length = " + result.length;
socket.close();
showResults(0);
};

showResults = function(index) {
var startpattern = new RegExp('class\="ttext">', "g");
var endpattern = new RegExp('<\/span><\/td>',"g");
var i = 0,j=0;
var hostinfo = new Array();
while ((thisIP = startpattern.exec(result)) != null) {
tmpstr = result.substring(startpattern.lastIndex, startpattern.lastIndex+30);
endpattern.lastIndex = 0;
if ((newvar = endpattern.exec(tmpstr)) != null) {
if (i==0)
hostinfo[j] = new Array(3);
hostinfo[j][i] = result.substring(startpattern.lastIndex,startpattern.lastIndex+newvar.index);
i = (i + 1) % 3;
if (i==0) j++;
}
else {
// System.print("No match on endpattern\n");
}
}
numHosts = j;
var k;
for (k=0; k < numHosts; k++) {
GUI.widget("HOSTNAME_"+(k+1)).label = hostinfo[k][1];
GUI.widget("IPADDRESS_"+(k+1)).label = hostinfo[k][0];
GUI.widget("MACADDRESS_"+(k+1)).label = hostinfo[k][2];
}
}

Connect_To_Server=function(ip,port) {
socket.connect(ip, port, 3000);
}

Connect_To_Server('192.168.1.1', 80);
OP | Post 3 made on Friday December 21, 2007 at 16:02
randman
Long Time Member
Joined:
Posts:
June 2003
424
Thanks for the tip. This sort of reminds me of the old days when I used to do CGI programming with a lot of regular expression code. Just in my home, I have over a dozen devices that have built in web servers, and it would be very useful to extract information from them and display in Pronto. For example, TiVos, web cams (would be great to show pictures in the Pronto), APC UPS (my APC has a network management card w/ built-in web server, although I may use APC's "proprietary" RS-232 protocol to access it), Linksys devices, etc. Now, if the Pronto can have a web browser, that would be great.... I guess I can use my iPhone, but hey, for home theater equipment, would be nice to have the data handy in Pronto!
Post 4 made on Friday December 21, 2007 at 16:51
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
13,006
That https:// might be a show-stopper.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 5 made on Friday December 21, 2007 at 17:24
MVis
Long Time Member
Joined:
Posts:
July 2007
94
On December 21, 2007 at 16:51, Lyndel McGee said...
That https:// might be a show-stopper.

Oops, yes, the base 64 authorization scheme wouldn't work from what I remember. It's much more complicated.
OP | Post 6 made on Friday December 21, 2007 at 18:08
randman
Long Time Member
Joined:
Posts:
June 2003
424
Looks like there's also a way to get the data in XML format for easier parsing, as discussed here:

[Link: xml.com]

However, not sure about the https:// issue being a showstopper as mentioned above... Why would https be a show stopper?
Post 7 made on Friday December 21, 2007 at 18:17
Barry Gordon
Founding Member
Joined:
Posts:
August 2001
2,157
http and https are both protocols enveloped in TCPIP. https uses a different port than http (443 vs 80) and there is an encryption layer between the normal http layer and the TCP layer in the protocol stack. Try Wikkipedia for more info; do a search on htpps.

Fundamentally there is no reason why the Pronto can not do https, you just need to open the socket on the correct port and handle the encryption/decryption layer. The Pronto is just as capable for https as it is for http if you get my drift.
OP | Post 8 made on Friday December 21, 2007 at 22:10
randman
Long Time Member
Joined:
Posts:
June 2003
424
Yes, I was just wondering if there was anything inherent with Prontoscript/Javascript that would make it not possible to use https, but from what you say, it should, theoretically be possible. Thanks.
Post 9 made on Saturday December 22, 2007 at 10:49
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
13,006
Barry is correct, it is possible but not likely feasible for the average user. Hence, a showstopper.

If you want to write the encryption/decryption layers in Javascript, you can get something working.

Most would say they had better things to do than this particular task. And if they did write it, the should consider selling it, not giving it away for free.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 10 made on Saturday December 22, 2007 at 12:05
randman
Long Time Member
Joined:
Posts:
June 2003
424
Unfortunately, https needs to be used to get the "Now Playing" list. When http is used, you just get a useless splash page and not the "Now Playing" list content. I could download the information from the TiVo into a PC, and then have Pronto query the PC, but that's not a pretty solution either. Now, if I could only find more time....


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse