Hack 54. wget Things from the Web

   

Hack 54 wget Things from the Web

figs/beginner.gif figs/hack54.gif

Bring the power of GNU wget , the ubiquitous file fetcher, to your TiVo .

http_get [Hack #53] is quite limited in what it can do. It's biggest limitation is that it can't talk to virtual hosts . As more and more web hosting shifts away from the one web server per IP address model, this can be an impediment.

The main reason that http_get can't talk to virtual hosted servers is because it can't do DNS resolution, relying instead on hard-coded IP addresses in the scripts that call it. In fact, the Linux installation running on the Series 1 TiVo doesn't have support for name resolution at all.

If you desperately must have a tool that can do name resolution for the Series 1, take a look at my wget.tcl (http://www.bitwaste.com/tivo/wget-tcl.tar.gz). The archive is packaged in a similar way. Just upload it to your TiVo, put it in /var , and extract it:

 bash-2.02#  gzip -d wget-tcl.tar.gz  bash-2.02#  cd /  bash-2.02#  cpio -i -H tar --make-directories < /var/wget-tcl.tar.gz  bash-2.02#  chmod 755 /var/hack/bin/wget.tcl  

This script and its supporting libraries are built upon the DNS support in the Tcllib (http://tcllib. sourceforge .net), enabling it do DNS resolution completely in Tcl. If you point the script at hacks.oreilly.com as in the previous command, it'll download index.html as before.

My wget.tcl , as of yet, does not handle FTP-based URLs.


   
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