56
56
B<--capabilities> Show which capabilities the grabber supports. For more
57
information, see L<http://membled.com/twiki/bin/view/Main/XmltvCapabilities>
57
information, see L<http://wiki.xmltv.org/index.php/XmltvCapabilities>
59
59
B<--version> Show the version of the grabber.
82
use XMLTV::Version '$Id: tv_grab_es_laguiatv,v 1.12 2010/03/12 07:53:45 candu_sf Exp $ ';
82
use XMLTV::Version '$Id: tv_grab_es_laguiatv,v 1.16 2010/11/21 14:49:59 dekarl Exp $ ';
83
83
use XMLTV::Capabilities qw/baseline manualconfig cache/;
84
84
use XMLTV::Description 'Spain (laguiatv.com)';
113
113
my $HEAD = { 'source-info-url' => 'http://www.laguiatv.com/programacion.php',
114
114
'source-data-url' => "http://www.laguiatv.com/programacion_vertical.php",
115
115
'generator-info-name' => 'XMLTV',
116
'generator-info-url' => 'http://membled.com/work/apps/xmltv/',
116
'generator-info-url' => 'http://xmltv.org/',
119
119
# Whether zero-length programmes should be included in the output.
136
# hard-coded list of TDT channels since laguia dont list them separately
142
"Factor{icute}a de Ficci{ocute}n Telecinco",
154
# hard-coded list of channels to hide from channel list
155
my @hide_channels = (
156
"Clan TVE 50", # missing / in name
137
160
######################################################################
646
669
foreach my $div(@divs)
648
671
my $class = $div->attr('class');
649
if ($class && $class eq "losdatos")
672
if ($class && $class eq "intro-datasheet")
651
674
# debug_print "got losdatos\n";
652
675
my @subdivs = $div->find_by_tag_name("_tag"=>"div");
654
677
foreach my $subdiv(@subdivs)
656
679
# debug_print "subdiv\n";
657
680
$class = $subdiv->attr('class');
658
if ($class && $class eq "entradilla")
681
if ($class && $class eq "text")
660
debug_print "got entradilla\n";
662
my $big_text = $div->as_text;
663
# debug_print "BigText: $big_text\n";
665
my $begin = index($big_text, "En este");
668
my $ep_text = substr($big_text, $begin + 7);
669
# Find the next colon
670
$begin = index($ep_text, ":");
673
$desc = substr($ep_text, $begin + 1);
683
my @ps = $div->find_by_tag_name("_tag"=>"p");
685
my $end = index($desc, "FICHA T");
688
$desc = substr($desc, 0, $end);
687
$class = $p->attr('class');
689
if ($class && $class eq "desc")
691
debug_print "got desc\n";
693
$desc = $desc . $p->as_text;
691
debug_print "Desc: $desc\n";
701
debug_print "desc: $desc\n";
697
703
return ($desc,$cat);
725
731
my $url="http://www.laguiatv.com/programacion.php";
728
738
my $tree = get_nice_tree $url;
740
# Add hard-coded TDT channels (bad chris)
741
foreach $channel_name (@tdt_channels)
743
$channel_id = convert_name_to_id($channel_name);
744
debug_print "Channel $channel_name, id $channel_id\n";
745
$channels{$channel_id}=$channel_name;
731
748
# <input type="checkbox" name="nacionales1" value="TVE 1"
732
749
# find the channels that are in check boxes
733
750
my @options = $tree->find_by_tag_name("_tag"=>"input");
739
752
foreach $elem (@options)
741
754
my $ename = $elem->attr('name');
794
# remove channels that should not be listed
795
foreach $channel_name (@hide_channels)
797
$channel_id = convert_name_to_id($channel_name);
798
delete $channels{$channel_id};
781
801
die "no channels could be found" if not keys %channels;
782
802
update $bar if not $opt_quiet;
783
803
$bar->finish() if not $opt_quiet;