It's raining in Boston, and you're stuck inside for the day. Take a virtual trip to a far-off tropical locale, without ever leaving your recliner.
It's winter time, and you're sitting at home, freezing, and wishing desperately that you could be some place warmer. While your TiVo is not going to beam you up to a tropical locale, perhaps it can provide some virtual heat.
The TiVo Home Media Option (HMO) [Hack #63] allows you to display a slideshow of your digital photos right on your television set. What about putting up live pictures from the Web, perhaps of some place you would rather be? Thanks to the dual miracles of webcams and wget [Hack #54], you can do just that.
Find your favorite Internet webcam�I personally like http://www.mauimanakai.com/webcam.htm�and figure out the URL of the image itself. You can easily do so by opening up the source of the web page on which it's displayed and doing some hunting and pecking.
Grab a copy of wget for your PC. Windows users will find a port at http://space.tin.it/computer/hherold/, while Mac OS X users will find theirs at http://www.apple.com/downloads/macosx/unix_open_source/wget.html. Install wget using the instructions provided with the application. Next, instruct it to download an image from the webcam and place it into a directory you're sharing with your TiVo through the HMO. On my Mac, I type:
$ wget -O /Users/r/Desktop/TiVo/webcam/image.jpg http://www.mauimanakai.com/ panasonic.jpg
Take a gander at the image using your TiVo's HMO Photo viewer. If all goes to plan, you should be transported�in mind at least�to your tropical paradise.
But a static picture won't satisfy you for long; you'll want to keep up the illusion by having a fresh version download every 5 minutes or so.
Your first instinct may be to use the Windows Task Scheduler. However, the smallest time interval it can work with is 1 hour. That just won't do! Thankfully, WinCron from DWG Software (http://www.dwgsoftware.com) is just the ticket.
Download, install, and start WinCron. If you've ever seen the command-line Unix version of cron [Hack #44], you'll find WinCron (shown in Figure 4-22) rather familiar, albeit slightly prettier.
Click the Add button to bring up an interface to adding a new scheduled task (see Figure 4-23).
Use the same wget command line that I used to grab the webcam image and paste it into the Command field. Make sure to specify the right path to wget (wget.exe, in this case) and pass it the right command-line arguments for output and download. Once you have all that squared away, set it up to run the command every five minutes. Click the Apply button, and that's that.
Setting up this repeating task in OS X is easy using cron [Hack #44]. At the Terminal (Applications Utilities Terminal), type:
$ crontab -e
Up comes your existing (or a new) crontab�in the vi text editor, most likely. Set the last line of your crontab to:
*/5 * * * * wget -O /Users/r/Desktop/TiVo/webcam/image.jpg http://www. mauimanaki.com/panasonic.com
Of course, you should replace the URL with the URL appropriate for the webcam that you are accessing, and you should also replace the download directory with the one on your Mac that the TiVo is going to be accessing. Save the updated crontab file and your Mac will, once every 5 minutes, download a fresh image and put it into the shared HMO directory.
Go back to the image on your TiVo and select it as a slideshow running with repeats, as shown in Figure 4-24. This way, you'll constantly have something to look at. And just leave it. As more and more images come in, the slideshow loop will get longer and longer, making it more possible for you to dream that you are actually there.
Top |