O'Reilly logo

TiVo Hacks by Raffi Krikorian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hack #93. Turning Favorites Lists into JavaScript

With a little Tcl, you can query TiVo for your favorite actors, preferred creatives, Now Showing List, and so forth. Syndicate those lists to your web site or weblog with a little JavaScript and the magic of TiVoWeb.

The problem with pipe-delimited lists [Hack #91] is that you have to get them off your TiVo to another machine and run yet another script to either process the list for display or generate something that you can manipulate. Seems a little complicated to me.

What if what you want is really simple? You just want to have a live version of your To Do List on your web site or weblog. You want anybody who goes to your site to see what's of interest to you on the tube—or at least what TiVo will be recording for you—over the next couple of days. What if I told you it was dirt simple and required none of that pipe-delimited nonsense?

Remember TiVoWeb [Hack #67]. Why not just write a module [Hack #78] that generates some JavaScript to be included in the web page of your choosing? That's exactly what we are going to do.

In fact, writing a TivoWeb module is decidedly simple, as you can see in the following code. TiVoWeb already has a database handle available for use by a module, and all we have to do is write whatever we are planning to write with a call to puts. Whatever you write will get shoved out the socket, right to the browser visiting your site.

The Code

proc action_jtodo { chan path env } { global db global tzoffset eval ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required