Hack 65. TiVoWeb, a Web Interface to Your TiVo

   

Hack 65 TiVoWeb, a Web Interface to Your TiVo

figs/moderate.gif figs/hack65.gif

TiVoWeb is the TiVo interface embodied in a web browser, allowing you full remote control of your TiVo from anywhere in the world .

Josha Foust's TiVoWeb (http://tivo.lightn.org/) predates TiVo's Home Media Option (HMO) and far outstrips it in terms of features. While the HMO's Remote Scheduling feature simply allows you to add something to your TiVo's recording schedule over the Web, TiVoWeb is almost the full TiVo interface embodied in a web browser. It allows direct manipulation of about every aspect of your PVR: manipulate your Season Passes, unschedule something from the To Do List , undelete a program you might have accidentally deleted, read your TiVo messages, and the list goes on and on.

A nice side effect of running TiVoWeb is the ability to manipulate your TiVo while it's doing something elseplaying back a recorded show, for instance.

Before you begin, you'll need a networked TiVo [Hack #49] with a Bash prompt [Hack #52]. You can even use a PPP-over-serial [Hack #47] instead of the TiVo/TurboWeb card in your Series 1.

Installing TiVoWeb

The first step is to download the TiVoWeb application code to the TiVo itself. There are many ways to do this, probably the easiest of which is to use the http_get utility [Hack #53] on the TiVo command line to grab the files from the TiVoWeb site:

 bash-2.02#  http_get -T 0 -C 0 -D /var/hack -U http://199.240.141.102 /   [RETURN]   tivoweb-tcl-1.9.4.tar.gz  

At the time of this writing, the current version of TiVoWeb is 1.9.4; be sure to check the TiVoWeb page for the latest, replacing tivoweb-tcl-1.9.4.tar.gz with the appropriate filename. Notice I used an IP address ( 199.240.141.102 ) in the download URL instead of the TiVoWeb domain name ( tivo.lightn.org) . http_get does not have domain name resolution capabilities, so it won't know where to find the TiVoWeb site.

Another option is to download the TiVoWeb application code ( tivoweb-tcl-1.9.4.tar.gz ) to another computer, enable the FTP server [Hack #55] on the TiVo, and upload the file.

Once the TiVoWeb application is onboard, move it into the /var/hack directory that we have been working in all along and unpack the archive, like so:

 bash-2.02#  mv tivoweb-tcl-1.9.4.tar.gz /var/hack  bash-2.02#  cd /var/hack  bash-2.02#  gzip -d tivoweb-tcl-1.9.4.tar.gz  bash-2.02#  cpio -H tar -i < tivoweb-tcl-1.9.4.tar  

Unfortunately, due to updates in the TiVo operating system, the default version of TiVoWeb does not handle the newest genre information your TiVo is keeping track of. So, before going any further, we are going to have to replace the ui.itcl file with one that has been patched to work. Josha talks about this at http://www.tivocommunity.com/tivo-vb/showthread.php?postid=973653#post973653 and provides code that you can paste into your ui.itcl file. You'll find an upgraded version at http://tivo.kitschcamppalace.org.uk/00ui.itcl.txt. Either download it to your PC and FTP it into your TiVo [Hack #54] to download it directly to TiVo. Once you have it moved into /var/hack/tivoweb-tcl/modules , install it:

 bash-2.02#  cd /var/hack/tivoweb-tcl/modules  bash-2.02#  mv 00ui.itcl.txt ui.itcl  

Starting TiVoWeb

That done, let's start the TiVoWeb server running:

 bash-2.02#  /var/hack/tivoweb-tcl/tivoweb console  

You will see a whole slew of data scrolling by. Most of these are status and debugging messages of the TiVoWeb code, detailing its startup procedure. We'll go through these messages in a little more detail later when we want to add different extensions to the code [Hack #78]. Ignore them for now.

An "Accepting Connections" status message signals that the server has started successfully. Point your browser to the IP address of your TiVo [Hack #51], and you should see the TiVoWeb's main screen, as shown in Figure 5-8.

Figure 5-8. The TiVoWeb main page
figs/tivo_0508.gif

Poking Around TiVoWeb

The first thing you should notice is that the menu items on this front page are the same as the menu items up top. That menu bar will always be visible, giving you quick access to the entire TiVoWeb from any web page inside the site.

Your first real stop should be User Interface , and a page resembling Figure 5-9 will show up on your browser. This page is at the heart of controlling your TiVo; almost everything you see on your TiVo Central menu on your television is going to appear here. Take a poke around.

Figure 5-9. The User Interface menu
figs/tivo_0509.gif

The Info menu shows you some random information about your TiVo, such as how much memory is being used and a calculated guess about how much space is currently allocated to television shows. If you want to guess what your TiVo is doing, take a gander at the Logs and from there you can see what your box is noting. MFS lets you browse through a representation of the MFS filesystem and, finally, the Resource Editor exposes a few of TiVo's internal variables for editing [Hack #97]. As for the rest of them, I'll get to them in a bit.

Stopping TiVoWeb

To shut down the TiVoWeb web server, visit the Restart menu, either from the main web page or menu bar at the top of the page, and select Quit. The server will shut itself down cleanly, and you'll get your command-line prompt back.

Do not simply type Control-C to shut down the TiVoWeb process from the command line. There's a rather good chance that the TiVo will reboot itself. TiVoWeb is built on top of something called TiVoSH (the TiVo Shell), which doesn't like to be interrupted during database access.


   
Top


Tivo Hacks. 100 Industrial-strength Tips Tools 2003
Tivo Hacks. 100 Industrial-strength Tips Tools 2003
ISBN: 1597490318
EAN: N/A
Year: 2004
Pages: 164

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net