--- tv_grab_cz.pl.bak 2010-12-21 20:33:37.000000000 +0100
+++ tv_grab_cz.pl 2010-12-21 22:35:48.000000000 +0100
@@ -161,6 +159,7 @@
my $id = &getChannelId($ch);
&download('POST', 'http://tv.sms.cz/kategorie/televize/volba_stanice.php',
(
+ 'P_soubor' => '%2Ftelevize%2Fvolba_stanice.php',
'tvs['.$id.']' => &getChannelCode($ch),
'pozice['.$id.']' => '',
'ulozit' => 'true'
@@ -178,12 +177,13 @@
# download page
my $html = Encode::decode_utf8 &download('GET', 'http://tv.sms.cz/index.php',
(
- 'P_soubor' => '%2Ftelevize%2Findex.php',
+ 'P_soubor' => '%2Ftelevize%2Findex.php%3Fdatum%3D'.$date,
'datum' => $date,
'casod' => '0' # 0 = since now; -1 = since the begining of the day
- )
+ )
);
+ $html =~ s/<table class="porad"/\n<table class="porad"/;
my @txt = split /\n/, $html;
foreach my $line (@txt) {
@@ -193,9 +193,9 @@
$icon{$ch} = $1;
}
}
-
- if ($line =~ /<table class="porad" /) {
- $line =~ s/<table class="porad" .[^>]+><tr><td .*?>(.*?)<\/table>/&parseHTML($1, $i, $ch, $date)/eg;
+
+ if ($line =~ /<table class="porad"/) {
+ $line =~ s/<table class="porad"><tr><td .*?>(.*?)<\/table>/&parseHTML($1, $i, $ch, $date)/eg;
}
}
}
@@ -927,7 +927,7 @@
my $txt;
foreach my $line (@html) {
- if ($line =~ /class="tv"/) {
+ if ($line =~ /class="tv_volba"/) {
$txt .= $line;
}
}
@@ -941,7 +941,7 @@
my @group = split /<div class="P_podnadpis">/, $txt;
for (my $i=1; $i<scalar @group; $i++) {
- my @chgrp = split /<div class="tv">/, $group[$i];
+ my @chgrp = split /<div class="tv_volba">/, $group[$i];
foreach my $ch (@chgrp) {
my $tvs = '';