xmltv/grab/uk_tvguide CHANGELOG, 1.5, 1.6 tv_grab_uk_tvguide, 1.6, 1.7
Geoff <[email protected]>
| Newsgroups | gmane.comp.tv.xmltv.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/xmltv/xmltv/grab/uk_tvguide
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23600
Modified Files:
CHANGELOG tv_grab_uk_tvguide
Log Message:
Use new Supplement methods
(minor) General code tidy-up
Index: tv_grab_uk_tvguide
===================================================================
RCS file: /cvsroot/xmltv/xmltv/grab/uk_tvguide/tv_grab_uk_tvguide,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** tv_grab_uk_tvguide 22 Dec 2013 14:49:54 -0000 1.6
--- tv_grab_uk_tvguide 8 Jan 2014 13:09:34 -0000 1.7
***************
*** 20,24 ****
use XMLTV::Options qw/ParseOptions/;
use XMLTV::Configure::Writer;
! use XMLTV::Get_nice qw(get_nice_tree);
use File::Path;
--- 20,25 ----
use XMLTV::Options qw/ParseOptions/;
use XMLTV::Configure::Writer;
! use XMLTV::Supplement 0.005065 qw/SetSupplementRoot GetSupplementDir GetSupplementLines/;
! use XMLTV::Get_nice qw/get_nice_tree/;
use File::Path;
***************
*** 44,48 ****
use XMLTV::Memoize; XMLTV::Memoize::check_argv('XMLTV::Get_nice::get_nice_aux');
! use subs qw(t warning);
my $warnings = 0;
--- 45,49 ----
use XMLTV::Memoize; XMLTV::Memoize::check_argv('XMLTV::Get_nice::get_nice_aux');
! use subs qw(debug warning);
my $warnings = 0;
***************
*** 170,174 ****
# All data fetched ok.
! t "Exiting without warnings.";
exit(0);
--- 171,175 ----
# All data fetched ok.
! debug "Exiting without warnings.";
exit(0);
***************
*** 198,202 ****
# Construct the listings url
my $url = $baseurl . '?ch=' . $channel_id . '&cTime=' . uri_escape( $theday->strftime('%m/%d/%Y 00:00:00') );
! # print STDERR $url ."\n";
# If we need to map the fetched channel_id to a different value
--- 199,203 ----
# Construct the listings url
my $url = $baseurl . '?ch=' . $channel_id . '&cTime=' . uri_escape( $theday->strftime('%m/%d/%Y 00:00:00') );
! #debug "Fetching: $url";
# If we need to map the fetched channel_id to a different value
***************
*** 248,252 ****
# $url = $ROOT_URL . 'detail.asp?id=' . $id;
my ($url) = $href =~ /javascript:popupshow\('(.*)'\);/;
! # print STDERR $url ."\n";
# Fetch the page
--- 249,253 ----
# $url = $ROOT_URL . 'detail.asp?id=' . $id;
my ($url) = $href =~ /javascript:popupshow\('(.*)'\);/;
! #debug "Fetching: $url";
# Fetch the page
***************
*** 545,549 ****
$prog{'episode-num'} = [[ $showepnum, 'xmltv_ns' ]];
}
! #print "--$showepnum-- ".$showepisode->as_text."\n";
}
--- 546,550 ----
$prog{'episode-num'} = [[ $showepnum, 'xmltv_ns' ]];
}
! #debug "--$showepnum-- ".$showepisode->as_text;
}
***************
*** 565,569 ****
$directors =~ s/ (singer|actor|actress) //ig; # strip these words
$directors =~ s/,,/,/g; # delete empties
! #print $directors."\n";
my @directors = split(/,/, $directors);
s{^\s+|\s+$}{}g foreach @directors; # strip leading & trailing spaces
--- 566,570 ----
$directors =~ s/ (singer|actor|actress) //ig; # strip these words
$directors =~ s/,,/,/g; # delete empties
! #debug $directors;
my @directors = split(/,/, $directors);
s{^\s+|\s+$}{}g foreach @directors; # strip leading & trailing spaces
***************
*** 582,586 ****
$actors =~ s/ (singer|actor|actress) //ig; # strip these words
$actors =~ s/,,/,/g; # delete empties
! #print $actors."\n";
my @actors = split(/,/, $actors);
s{^\s+|\s+$}{}g foreach @actors; # strip leading & trailing spaces
--- 583,587 ----
$actors =~ s/ (singer|actor|actress) //ig; # strip these words
$actors =~ s/,,/,/g; # delete empties
! #debug $actors;
my @actors = split(/,/, $actors);
s{^\s+|\s+$}{}g foreach @actors; # strip leading & trailing spaces
***************
*** 604,608 ****
! # print Dumper \%prog;
push(@{$programmes}, \%prog);
}
--- 605,609 ----
! # debug Dumper \%prog;
push(@{$programmes}, \%prog);
}
***************
*** 640,644 ****
#
my ($s, $e, $e_of, $p, $p_of) = @_;
! # print Dumper(@_);
# "Part x of x" may contaain integers or words (e.g. "Part 1 of 2", or "Part one")
--- 641,645 ----
#
my ($s, $e, $e_of, $p, $p_of) = @_;
! # debug Dumper(@_);
# "Part x of x" may contaain integers or words (e.g. "Part 1 of 2", or "Part one")
***************
*** 661,665 ****
$episode_ns .= '/'.$p_of if defined $p_of;
! #print "--$episode_ns--";
return $episode_ns;
}
--- 662,666 ----
$episode_ns .= '/'.$p_of if defined $p_of;
! #debug "--$episode_ns--";
return $episode_ns;
}
***************
*** 714,734 ****
my $mapcategories = \%mapcategoryhash;
#
! my $fn = get_supplement_dir() . '/'. $GRABBER_NAME . '.map.conf';
! my $fhok = open my $fh, '<', $fn or warning("Cannot open conf file $fn");
! if ($fhok) {
! while (my $line = <$fh>) {
! chomp $line;
! chop($line) if ($line =~ m/\r$/);
! next if $line =~ /^#/ || $line eq '';
my ($type, $mapfrom, $mapto, $trash) = $line =~ /^(.*)==(.*)==(.*?)([\s\t]*#.*)?$/;
SWITCH: {
lc($type) eq 'map' && do { $mapchannels->{$mapfrom} = $mapto; last SWITCH; };
lc($type) eq 'cat' && do { $mapcategories->{$mapfrom} = $mapto; last SWITCH; };
! warning("Unknown type in map file: \n $line");
}
}
! close $fh;
! }
! # print Dumper ($mapchannels, $mapcategories);
}
--- 715,730 ----
my $mapcategories = \%mapcategoryhash;
#
! my $supplementdir = $ENV{XMLTV_SUPPLEMENT} || GetSupplementDir();
! SetSupplementRoot($supplementdir);
! my $lines = GetSupplementLines($GRABBER_NAME, $GRABBER_NAME . '.map.conf');
! foreach my $line (@$lines) {
my ($type, $mapfrom, $mapto, $trash) = $line =~ /^(.*)==(.*)==(.*?)([\s\t]*#.*)?$/;
SWITCH: {
lc($type) eq 'map' && do { $mapchannels->{$mapfrom} = $mapto; last SWITCH; };
lc($type) eq 'cat' && do { $mapcategories->{$mapfrom} = $mapto; last SWITCH; };
! warning "Unknown type in map file: \n $line";
}
}
! # debug Dumper ($mapchannels, $mapcategories);
}
***************
*** 753,758 ****
my $_channels = $tree->look_down('_tag' => 'select', 'name' => 'ch');
my @channels = $_channels->look_down('_tag' => 'option');
! # print $_channels->as_HTML;
! # foreach my $xchannel (@channels) { print $xchannel->as_HTML; }
$bar->update() && $bar->finish && undef $bar if defined $bar;
--- 749,754 ----
my $_channels = $tree->look_down('_tag' => 'select', 'name' => 'ch');
my @channels = $_channels->look_down('_tag' => 'option');
! # debug $_channels->as_HTML;
! # foreach my $xchannel (@channels) { debug $xchannel->as_HTML; }
$bar->update() && $bar->finish && undef $bar if defined $bar;
***************
*** 847,855 ****
}
- sub get_supplement_dir {
- return $ENV{XMLTV_SUPPLEMENT} . "/" . $GRABBER_NAME if defined( $ENV{XMLTV_SUPPLEMENT} );
- return get_default_dir() . "/.xmltv/supplement/" . $GRABBER_NAME;
- }
-
sub get_default_cachedir {
return get_default_dir() . "/.xmltv/cache";
--- 843,846 ----
***************
*** 872,881 ****
}
! sub t {
! my( $message ) = @_;
! print STDERR $message . "\n" if $opt->{debug};
}
! sub warning {
my( $message ) = @_;
print STDERR $message . "\n";
--- 863,873 ----
}
! sub debug ( $$ ) {
! my( $message, $nonewline ) = @_;
! print STDERR $message if $opt->{debug};
! print STDERR "\n" unless (defined $nonewline && $nonewline == 1);
}
! sub warning ( $ ) {
my( $message ) = @_;
print STDERR $message . "\n";
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/xmltv/xmltv/grab/uk_tvguide/CHANGELOG,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** CHANGELOG 22 Dec 2013 14:49:54 -0000 1.5
--- CHANGELOG 8 Jan 2014 13:09:34 -0000 1.6
***************
*** 1,2 ****
--- 1,3 ----
+ 1.7 8-Jan-2014 Use new Supplement methods & General code tidy-up
1.6 22-Dec-2013 Fix for special dates
1.5 14-Dec-2013 Fix for website changes
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk