xmltv
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
my %new_filetypes = (plaindoc => \%doc_files, share => \%share_files);
my %seen_dir;
foreach my $filetype (sort keys %new_filetypes) {
my $uc = uc $filetype;
our %files; local *files = $new_filetypes{$filetype};
foreach my $src (sort keys %files) {
my $inst_pos = $files{$src};
my $extra = '';
# The directory containing this file in blib/ needs to be created.
my @dirs = split m!/!, $inst_pos; pop @dirs;
foreach (0 .. $#dirs) {
my $dir = join('/', @dirs[0 .. $_]);
my $parent = join('/', @dirs[0 .. $_-1]);
next if $seen_dir{$dir}++;
die if (length $parent and not $seen_dir{$parent});
my $parent_exists = "\$(INST_$uc)/$parent/.exists";
$parent_exists =~ tr!/!/!s;
$extra .= <<END
\$(INST_$uc)/$dir/.exists :: \$(PERL_INC)/perl.h $parent_exists
\@\$(MKPATH) \$(INST_$uc)/$dir
filter/tv_extractinfo_en view on Meta::CPAN
=head1 DESCRIPTION
Read XMLTV data and attempt to extract information from
English-language programme descriptions, putting it into
machine-readable form. For example the human-readable text '(repeat)'
in a programme description might be replaced by the XML element
<previously-shown>.
B<--output FILE> write to FILE rather than standard output
This tool also attempts to split multipart programmes into their
constituents, by looking for a description that seems to contain lots
of times and titles. But this depends on the description following
one particular style and is useful only for some listings sources
(Ananova).
If some text is marked with the 'lang' attribute as being some
language other than English ('en'), it is ignored.
=head1 SEE ALSO
grab/de_tvtoday/tv_grab_de_tvtoday.in view on Meta::CPAN
$content =~ s/(^\s|\s$)//g;
if ($headline =~ m/ShowView:/) {
die unless($content =~ m/ShowView ([0-9\-]+)/);
$show->{"showview"} = $1 unless($1 eq "99-999-999");
}
elsif ($headline =~ m/Genre:/) {
$show->{"category"} = [[ $content, $lang ]];
}
elsif ($headline =~ m/Regie:/) {
my @tmp = split m/\s*,\s*/, $content;
add_credits($show, 'director', @tmp);
}
elsif ($headline =~ m/Darsteller:/) {
my @tmp = split m/\s*,\s*/, $content;
add_credits($show, 'actor', @tmp);
}
elsif ($headline =~ m/FSK:/) {
die unless($content =~ m/ab ([0-9]+)/);
warn "discarding fsk's age recommendations"
unless $warned_discarding_fsk++;
}
else {
warn "haven't heard of headline $headline yet, adding to description";
my $add = "$headline: $content";
grab/de_tvtoday/tv_grab_de_tvtoday.in view on Meta::CPAN
$show->{"country"} = [[ $parts[4], $lang ]];
$show->{"date"} = parse_date_data($parts[5]);
}
#-- $parts[7] specifies the director (German: Regisseur)
if (defined($parts[7])) {
$parts[7] =~ s/\s*u.a.\s*$//;
$parts[7] =~ s/\([^\(\)]+\)//g;
$parts[7] =~ s/&/&/g;
my @people = split m/(?:\s+und\s+|\s*[,;]\s*)/, $parts[7];
my @jobs;
if ($parts[6] eq 'R') {
@jobs = qw(director);
}
elsif ($parts[6] eq 'Buch/Regie') {
@jobs = qw(director writer);
}
else {
warn "don't understand 'director' type $parts[6]";
}
grab/de_tvtoday/tv_grab_de_tvtoday.in view on Meta::CPAN
push @{$show->{credits}{$_}}, @people
foreach @jobs;
}
if (defined($parts[9])) {
#-- $parts[9] specifies the actors (German: Darsteller)
$parts[9] =~ s/\s*u.a.\s*$//;
$parts[9] =~ s/\([^\(\)]+\)//g;
$parts[9] =~ s/&/&/g;
my @actor = split m/(?:\s+und\s+|\s*[,;]\s*)/, $parts[9];
push @{$show->{"credits"}{"actor"}}, @actor;
}
}
else {
my @data = split "·", $$desc;
s/(^\s|\s$)//g foreach(@data); #CHG#
if(scalar(@data) == 3
&& not($data[1] =~ m/[\wäöüßÄÖÜ]+:/) #- FIX false positive: tvtoday.de seems to publish "guests: <names>" here some (rare) times :-(
&& $data[2] =~ m/^Mit (.*?)$/) {
( run in 0.735 second using v1.01-cache-2.11-cpan-71847e10f99 )