/var/www/tv/
on the first line.tv/storage_modules/flat_file.pm
has a path on line 33.Televinken is being developed on a machine running Debian GNU/Linux, so it should be rather painless to install it. Right? :-)
Start by downloading the tarball and unpack it into
/var/www/
. Run fetch_listings.pl
and check
for errors. If you get something that resembles the output below
everything is fine.
lindahl@fugu:~$ tar -xzf tvdist_2003-06-07.tgz -C /var/www/ lindahl@fugu:~$ cd /var/www/tv/ lindahl@fugu:~$ chmod +x *.cgi lindahl@fugu:/var/www/tv$ ./fetch_listings.pl Id: fetch_listings.pl,v 1.10 2003/04/27 07:50:14 lindahl Exp AnimalPlanet: Fetching AnimalPlanet from Dagens TV (dagenstv.com) http://www.dagenstv.com/se/chart/?cha=54&dat=2003-06-07 Got 27 lines. BBCPrime: Fetching BBCPrime from Dagens TV (dagenstv.com) http://www.dagenstv.com/se/chart/?cha=2&dat=2003-06-07 Got 46 lines. BBCWorld: Fetching BBCWorld from Dagens TV (dagenstv.com) http://www.dagenstv.com/se/chart/?cha=3&dat=2003-06-07 Got 48 lines. [...] p3: Fetching p3 from Sveriges Radio (www.sr.se) http://www.sr.se/p3/p3tabla/t2003/t030607.htm Got 62 lines. p4: Fetching p4 from Sveriges Radio (www.sr.se) http://www.sr.se/p4/p4tabla/t2003/t030607.htm Got 76 lines. Sending 787 programs to storage...Done! Storing sources...Done! lindahl@fugu:/var/www/tv$
You most probably want to run fetch_listings.pl
automatically every morning via crontab. I use the following settings:
#Min Hr DoM Month DoW Command 15 06 * * * /var/www/tv/fetch_listings.pl
There are many web servers availabe. The only thing we need is CGI support. My choice for this documentation is Boa, because it is tiny and competent enough.
So, install Boa. That is, apt-get install boa
.
Edit /etc/boa/boa.conf
, make sure the following line is enabled:
# Uncomment the next line if you want .cgi files to execute from anywhere AddType application/x-httpd-cgi cgi
Restart Boa (/etc/init.d/boa restart
). Now, everything
should work, time to surf to http://localhost/tv/ (for different
values of "localhost").
If the listing is unreadable (well, rot13...), you might want to edit
the initial if-clause in tvdiv.pm
############################################################ our $mess_up_text = undef; $mess_up_text = 1 if ($ENV{REMOTE_ADDR} && (not # Private ip networks ($ENV{REMOTE_ADDR} =~ /^10\./ || $ENV{REMOTE_ADDR} =~ /^169\.254\./ || $ENV{REMOTE_ADDR} =~ /^172\.1[6789]\./ || $ENV{REMOTE_ADDR} =~ /^172\.2[0123456789]\./ || $ENV{REMOTE_ADDR} =~ /^172\.3[01]\./ || $ENV{REMOTE_ADDR} =~ /^192.168.1./ || # Liu $ENV{REMOTE_ADDR} =~ /^130\.236\./))); # Uncomment the following line to enable unscrambled text for everybody. #$mess_up_text = undef; ############################################################
Uncomment the last row or remove everything but our
$mess_up_text=undef;
, and your listing will make a lot more
sense.
Boa executes cgi programs from its root directory, by default
/etc/boa
. The logs does not contain much useful
information, my advice is to switch to the www-data
user
and try to run the scripts manually if something does not work.