summaryrefslogtreecommitdiff
path: root/epg2html.pl
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2000-12-01 18:37:46 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2000-12-01 18:37:46 +0100
commitc8a1be81af458ba096239461d69245c914070516 (patch)
tree626b678533e12772c4f2b9f96baeb4f4bcc3ea13 /epg2html.pl
parentd2fec895294e5ea0b6cc3d68f4af5dbcc9259c09 (diff)
downloadvdr-c8a1be81af458ba096239461d69245c914070516.tar.gz
vdr-c8a1be81af458ba096239461d69245c914070516.tar.bz2
Fixed handling of channel names that contain '/'
Diffstat (limited to 'epg2html.pl')
-rwxr-xr-xepg2html.pl11
1 files changed, 6 insertions, 5 deletions
diff --git a/epg2html.pl b/epg2html.pl
index 06d76b74..215eb735 100755
--- a/epg2html.pl
+++ b/epg2html.pl
@@ -12,7 +12,7 @@
# See the main source file 'vdr.c' for copyright information and
# how to reach the author.
#
-# $Id: epg2html.pl 1.1 2000/11/26 15:23:39 kls Exp $
+# $Id: epg2html.pl 1.2 2000/12/01 18:37:46 kls Exp $
@Index = ();
@@ -39,9 +39,10 @@ while (<>) {
chomp;
if (/^C ([^ ]+) *(.*)/) {
my $Channel = $2;
- (my $Page = $Channel) =~ s/ /_/g;
+ (my $Page = $Channel) =~ y/\/ /-_/;
+ $Page .= ".htm";
$Channel = Tags($Channel);
- push(@Index, qq{<a href="$Page.htm">$Channel</a><br>\n});
+ push(@Index, qq{<a href="$Page">$Channel</a><br>\n});
my %Events = ();
while (<>) {
if (/^E (.*) (.*) (.*)/) {
@@ -75,7 +76,7 @@ while (<>) {
push(@Schedule, "<tr><td valign=top>" . GetTime($t) . "</td><td>$Entry</td></tr>\n");
}
push(@Schedule, "</table>\n") if (@Schedule);
- open(PAGE, ">$Page.htm") or die $!;
+ open(PAGE, ">$Page") or die "$Page: $!\n";
print PAGE "<html>\n<head><title>$Channel</title><head>\n<body>\n";
print PAGE "<h1>$Channel</h1>\n";
print PAGE @Schedule;
@@ -87,7 +88,7 @@ while (<>) {
}
}
-open(INDEX, ">index.htm") or die $!;
+open(INDEX, ">index.htm") or die "index.htm: $!\n";
print INDEX "<html>\n<head><title>EPG Index</title><head>\n<body>\n";
print INDEX sort { lc($a) cmp lc($b) } @Index;
print INDEX "</body>\n</html>\n";