You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(95) |
Dec
(62) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(70) |
Feb
(137) |
Mar
(102) |
Apr
(50) |
May
(62) |
Jun
(6) |
Jul
|
Aug
(12) |
Sep
(146) |
Oct
(108) |
Nov
(49) |
Dec
(84) |
2003 |
Jan
(60) |
Feb
(126) |
Mar
(111) |
Apr
(170) |
May
(162) |
Jun
(87) |
Jul
(88) |
Aug
(51) |
Sep
(50) |
Oct
(24) |
Nov
(95) |
Dec
(62) |
2004 |
Jan
(93) |
Feb
(81) |
Mar
(106) |
Apr
(94) |
May
(109) |
Jun
(8) |
Jul
(22) |
Aug
(15) |
Sep
(82) |
Oct
(26) |
Nov
(44) |
Dec
(28) |
2005 |
Jan
(25) |
Feb
(17) |
Mar
(27) |
Apr
(7) |
May
(25) |
Jun
(22) |
Jul
(21) |
Aug
(22) |
Sep
(11) |
Oct
(15) |
Nov
(20) |
Dec
(42) |
2006 |
Jan
(200) |
Feb
(42) |
Mar
(56) |
Apr
(91) |
May
(37) |
Jun
(54) |
Jul
(33) |
Aug
(15) |
Sep
(26) |
Oct
(30) |
Nov
(71) |
Dec
(102) |
2007 |
Jan
(48) |
Feb
(40) |
Mar
(24) |
Apr
(25) |
May
(7) |
Jun
(14) |
Jul
(35) |
Aug
(32) |
Sep
(28) |
Oct
(55) |
Nov
(57) |
Dec
(14) |
2008 |
Jan
(40) |
Feb
(32) |
Mar
(25) |
Apr
(29) |
May
(16) |
Jun
(49) |
Jul
(26) |
Aug
(31) |
Sep
(7) |
Oct
(16) |
Nov
(11) |
Dec
(13) |
2009 |
Jan
(13) |
Feb
(30) |
Mar
(38) |
Apr
(8) |
May
(23) |
Jun
(19) |
Jul
(24) |
Aug
(46) |
Sep
(65) |
Oct
(30) |
Nov
(28) |
Dec
(37) |
2010 |
Jan
(31) |
Feb
(41) |
Mar
(43) |
Apr
(82) |
May
(39) |
Jun
(40) |
Jul
(31) |
Aug
(46) |
Sep
(104) |
Oct
(55) |
Nov
(67) |
Dec
(32) |
2011 |
Jan
(26) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
(17) |
Mar
(32) |
Apr
(34) |
May
(15) |
Jun
(50) |
Jul
(19) |
Aug
(8) |
Sep
(16) |
Oct
(18) |
Nov
(12) |
Dec
(3) |
2013 |
Jan
(7) |
Feb
(11) |
Mar
(11) |
Apr
(13) |
May
(17) |
Jun
(5) |
Jul
(4) |
Aug
(2) |
Sep
(4) |
Oct
(44) |
Nov
(14) |
Dec
(57) |
2014 |
Jan
(42) |
Feb
(11) |
Mar
(13) |
Apr
(33) |
May
(48) |
Jun
(22) |
Jul
(7) |
Aug
(19) |
Sep
(11) |
Oct
(34) |
Nov
(12) |
Dec
(18) |
2015 |
Jan
(17) |
Feb
(17) |
Mar
(15) |
Apr
(23) |
May
(2) |
Jun
(41) |
Jul
(31) |
Aug
(33) |
Sep
(6) |
Oct
(5) |
Nov
(8) |
Dec
(23) |
2016 |
Jan
(9) |
Feb
(6) |
Mar
(26) |
Apr
(2) |
May
(24) |
Jun
(20) |
Jul
(34) |
Aug
(4) |
Sep
(1) |
Oct
|
Nov
(2) |
Dec
(1) |
2017 |
Jan
(17) |
Feb
(6) |
Mar
(8) |
Apr
|
May
(1) |
Jun
(1) |
Jul
(4) |
Aug
(4) |
Sep
(14) |
Oct
(1) |
Nov
(8) |
Dec
|
From: Jerry V. <jve...@us...> - 2001-11-02 18:09:33
|
Update of /cvsroot/xmltv/xmltv/todo In directory usw-pr-cvs1:/tmp/cvs-serv16014/todo Added Files: TASKS.epa Log Message: xmltv-0.2.0 --- NEW FILE: TASKS.epa --- This is my todo list, it relates mostly to UK listings-grabbing and the other stuff I wrote. -- Ed Avis, ep...@do... 4Learning - done morning on 3 - done (lw) (fm) - done FILM 1978 DESC - done trailing semicolon in desc - done store yes/no, not maybe - done richard e. grant stars in - done news;weather (check mail) - done As World Service news; radio 3 lunchtime concert - contained in source HTML pick.cgi actually output XML, or something Pink Panther film vs cartoon todos in DTD Gareth Hale guests blank lines in sort_listings output FIXMEs use the TVChannels.pm module |
From: Jerry V. <jve...@us...> - 2001-11-02 18:08:55
|
Update of /cvsroot/xmltv/xmltv/todo/TVChannels_module In directory usw-pr-cvs1:/tmp/cvs-serv15790/TVChannels_module Log Message: Directory /cvsroot/xmltv/xmltv/todo/TVChannels_module added to the repository |
From: Jerry V. <jve...@us...> - 2001-11-02 18:08:41
|
Update of /cvsroot/xmltv/xmltv/todo In directory usw-pr-cvs1:/tmp/cvs-serv15670/todo Log Message: Directory /cvsroot/xmltv/xmltv/todo added to the repository |
From: Jerry V. <jve...@us...> - 2001-11-02 18:07:22
|
Update of /cvsroot/xmltv/xmltv In directory usw-pr-cvs1:/tmp/cvs-serv14737 Modified Files: ChangeLog README filter_shown getlistings_pa listings_to_latex pick_cgi xmltv.dtd Added Files: tz.pl Log Message: xmltv-0.1.1 --- NEW FILE: tz.pl --- # tz.pl # # Timezone stuff. Include this _after_ importing Date::Manip. Should # really put this in a proper module. # # -- Ed Avis, ep...@do..., 2000-07-28 # # parse_uk_date() # # Wrapper for ParseDate() that tries to guess what timezone a date is # in (UT or BST). If the date already has either of these it is left # alone. # # This will probably fail horribly if you use it for dates which # aren't in either of these timezones. But since summer time starts # and ends at the same time throughout the EU it wouldn't be hard to # make it work for some other countries. # # Parameters: unparsed date from the UK (or other places using UT/BST) # Returns: parsed date # # There's a one hour window where dates are ambigous; we assume UT # for these and print a warning. Similarly there's a one hour window # where dates without a timezone are impossible; we die on those. # sub parse_uk_date($) { die 'usage: parse_uk_date(unparsed date)' if @_ != 1; my $date = shift; if (defined gettz($date)) { # An explicit timezone, no need for any funny business return ParseDate($date); } # FIXME: what if it has a timezone and it's not UT or UT+1? my $dp = ParseDate($date); die "bad date $date" if not defined $dp or $dp eq ''; # Start and end of summer time in that year my ($start_bst, $end_bst) = @{bst_dates(UnixDate($dp, '%Y'))}; # The clocks shift backwards and forwards by one hour. my $clock_shift = "1 hour"; # The times that the clocks go forward to / back to. my $start_bst_skipto = DateCalc($start_bst, "+ $clock_shift"); my $end_bst_backto = DateCalc($end_bst, "- $clock_shift"); if (Date_Cmp($dp, $start_bst) < 0) { # Before the start of summer time. return $dp; } elsif (Date_Cmp($dp, $start_bst) == 0) { # Exactly _at_ the start of summer time. Really such a date # should not exist since the clocks skip forward an hour at # that point. # return $dp; } elsif (Date_Cmp($dp, $start_bst_skipto) < 0) { die("$date is impossible " . "(summer time skips from $start_bst to $start_bst_skipto)" ); } elsif (Date_Cmp($dp, $end_bst_backto) < 0) { # During summer time. FIXME: store timezone names as # constants. # return Date_ConvTZ($dp, 'BST', 'UT'); } elsif (Date_Cmp($dp, $end_bst) <= 0) { warn("$date is ambiguous " . "(clocks go back from $end_bst to $end_bst_backto), " . "assuming not summer time" ); return $dp; } else { # Definitely after the end of summer time. return $dp; } } # date_to_uk() # # Take a date in UT and convert it to a BST date if needed. # # Parameters: date in UT (from ParseDate()) # # Returns ref to list of # new date (maybe shifted by one hour), # timezone of new date ('UT' or 'BST') # # For example, date_to_uk of 13:00 on June 10th 2000 would be 14:00 # BST on the same day. The input and output date are both in # Date::Manip internal format. # sub date_to_uk($) { die 'usage: date_to_uk(date in Date::Manip format)' if @_ != 1; my $d = shift; my $year = UnixDate($d, '%Y'); if ((not defined $year) or ($year !~ tr/0-9//)) { die "cannot get year from '$d'"; } # Find the start and end dates in March and October my ($start_bst, $end_bst) = @{bst_dates($year)}; # The clocks shift backwards and forwards by one hour. my $clock_shift = "1 hour"; if (Date_Cmp($d, $start_bst) < 0) { # Before the start of summer time. return [ $d, 'UT' ]; } elsif (Date_Cmp($d, $end_bst) < 0) { # During summer time. return [ DateCalc($d, "+ $clock_shift"), 'BST' ]; } else { # After summer time. return [ $d, 'UT' ]; } } # bst_dates() # # Return the dates (in UT) when British Summer Time starts and ends in # a given year. # # According to # <http://www.rog.nmm.ac.uk/leaflets/summer/summer.html>, summer # time starts at 01:00 on the last Sunday in March, and ends at # 01:00 on the last Sunday in October. This has been the case # since 1998 - earlier dates are not handled. # # Parameters: year (only 1998 or later works) # # Returns: ref to list of # start time and date of summer time (in UT) # end time and date of summer time (in UT) # sub bst_dates($) { die 'usage: bst_dates(year)' if @_ != 1; my $year = shift; die "don't know about BST before 1998" if $year < 1998; my ($start_bst, $end_bst); foreach (1 .. 31) { my $mar = "$year-03-$_" . ' 01:00'; my $mar_d = ParseDate($mar) or die "cannot parse $mar"; $start_bst = $mar_d if UnixDate($mar_d, "%A") =~ /Sunday/; # N.B. 01:00 UT == 00:00 BST. A time between '23:00' and # '00:00' just before the last Sunday in October is ambiguous. # my $oct = "$year-10-$_" . ' 00:00'; my $oct_d = ParseDate($oct) or die "cannot parse $oct"; $end_bst = $oct_d if UnixDate($oct_d, "%A") =~ /Sunday/; } die if not defined $start_bst or not defined $end_bst; return [ $start_bst, $end_bst ]; } # gettz() # # Parameters: unparsed date string # Returns: timezone (a substring), or undef # # The only timezones supported are UT (aka GMT) and BST. # sub gettz($) { die 'usage: gettz(unparsed date string)' if @_ != 1; local $_ = shift; /(UT|GMT|BST)/ && return $1; /(\+0000|\+0100)/ && return $1; return undef; } 1; Index: ChangeLog =================================================================== RCS file: /cvsroot/xmltv/xmltv/ChangeLog,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ChangeLog 2001/11/02 17:58:43 1.1 --- ChangeLog 2001/11/02 18:07:18 1.2 *************** *** 1,2 **** --- 1,31 ---- + 2000-07-28 Edward Avis <ep...@do...> + + * xmltv.dtd: specify date format for all dates + + * getlistings_pa: print timezones when they change + + * tz.pl: new file for British timezone routines + + * listings_to_latex: persuaded XMLin() to read ordinary filenames + + * getlistings_pa: use the Memoize module to speed things up + + * getlistings_pa: dates converted to UT when reading, and back again + when writing + + 2000-07-24 Edward Avis <ep...@do...> + + * getlistings_pa: tell HTML::Parser not to break chunks of text + + 2000-07-21 Edward Avis <ep...@do...> + + * filter_shown: add -d flag to specify date instead of 'now' + + 2000-07-11 Edward Avis <ep...@do...> + + * getlistings_pa: changed a couple of dies to warnings + (extract_prog($)): remove '&' characters from description + (extract_prog($)): clean up all text, not just descriptions + 2000-07-03 Edward Avis <ep...@do...> Index: README =================================================================== RCS file: /cvsroot/xmltv/xmltv/README,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** README 2001/11/02 17:58:43 1.1 --- README 2001/11/02 18:07:18 1.2 *************** *** 1,3 **** ! XMLTV 0.1 Suite of programs for processing TV listings and organizing your --- 1,3 ---- ! XMLTV 0.1.1 Suite of programs for processing TV listings and organizing your *************** *** 9,13 **** pick_cgi as a CGI script. ! This release is not ready for end users. This is free software distributed under the GPL, see COPYING. --- 9,15 ---- pick_cgi as a CGI script. ! This release is not ready for end users. There have been lots of ! changes since the last release, notably the introduction of timezones, ! and the fact that it might actually work. This is free software distributed under the GPL, see COPYING. *************** *** 16,18 **** <http://www.doc.ic.ac.uk/~epa98/work/apps/xmltv/>. ! -- Ed Avis, ep...@do..., 2000-07-03 --- 18,20 ---- <http://www.doc.ic.ac.uk/~epa98/work/apps/xmltv/>. ! -- Ed Avis, ep...@do..., 2000-07-28 Index: filter_shown =================================================================== RCS file: /cvsroot/xmltv/xmltv/filter_shown,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** filter_shown 2001/11/02 17:58:43 1.1 --- filter_shown 2001/11/02 18:07:18 1.2 *************** *** 3,9 **** # filter_shown # ! # Filter TV listings, removing programmes that have already finished. # ! # Usage: filter_shown [filename] # # Reads from filename, or stdin if no filename given, and writes --- 3,10 ---- # filter_shown # ! # Filter TV listings, removing programmes that would have already ! # finished at a given date and time (defaults to now). # ! # Usage: filter_shown [-d date] [filename] # # Reads from filename, or stdin if no filename given, and writes *************** *** 16,25 **** use XML::DOM; use Date::Manip; ! die "usage: $0 [filename]" if @ARGV >= 2; ! @ARGV = ('-') if not @ARGV; ! # TODO: Maybe a command line option to give the date? ! my $now = ParseDate('today'); my $p = new XML::DOM::Parser; --- 17,29 ---- use XML::DOM; use Date::Manip; + use Getopt::Std; ! use vars '$opt_d'; ! getopt('d'); ! $opt_d = 'today' if not defined $opt_d; ! my $now = ParseDate($opt_d); ! die "usage: $0 [-d date] [filename]" if @ARGV >= 2; ! @ARGV = ('-') if not @ARGV; my $p = new XML::DOM::Parser; Index: getlistings_pa =================================================================== RCS file: /cvsroot/xmltv/xmltv/getlistings_pa,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** getlistings_pa 2001/11/02 17:58:43 1.1 --- getlistings_pa 2001/11/02 18:07:18 1.2 *************** *** 45,55 **** use strict; use HTML::TokeParser; ! use Date::Manip; use LWP::Simple; - use Term::ReadKey; use XML::Writer; - use Text::Wrap; ######## # Configuration --- 45,81 ---- use strict; use HTML::TokeParser; ! ! # Date::Manip is used for parsing dates; all dates are stored ! # internally in UT (aka GMT). ! # ! use Date::Manip; Date_Init('TZ=UT'); ! require 'tz.pl'; ! use LWP::Simple; use XML::Writer; + # I have a module I use for trace messages; you can get it at + # <http://www.doc.ic.ac.uk/~epa98/lib/perl5/site_perl/Dbg.pm>. That's + # what all the t('hello') type statements are. But you can probably + # just leave them commented out. + # + #use Dbg; $Dbg::On = 0; + # Memoize some subroutines if possible (25x speedup) + eval { require Memoize }; + if ($@) { + warn "could not load Memoize module, things will run slowly"; + } + else { + foreach (qw/istime time12to24 parse_uk_date date_to_uk bst_dates + gettz ParseDate UnixDate DateCalc Date_Cmp + ParseDateDelta/) + { + Memoize::memoize($_) or die "cannot memoize $_: $!"; + } + } + + + ######## # Configuration *************** *** 62,66 **** # Quicker version for testing ! #my @CHANNELS = qw[bbc1]; #my $NUMDAYS = 1; --- 88,92 ---- # Quicker version for testing ! #my @CHANNELS = qw[ch5]; #my $NUMDAYS = 1; *************** *** 235,243 **** # Given a list of programme details (from extract_prog()) and the date # of this listing, remove the silly 12 hour times and add proper time ! # and date for each programme. # # Parameters: # reference to list of programme details ! # date (in Date::Manip format) # # Modifies the list passed in, so that each programme no longer has --- 261,269 ---- # Given a list of programme details (from extract_prog()) and the date # of this listing, remove the silly 12 hour times and add proper time ! # and date for each programme. In UT. # # Parameters: # reference to list of programme details ! # date in format YYYYMMDD # # Modifies the list passed in, so that each programme no longer has *************** *** 247,265 **** die 'usage: date_programmes(ref to list of programmes, date)' if @_ != 2; ! my ($progs, $date) = @_; ! my $prev_date; - my $base_day = $date; my $day_later = ParseDateDelta('+1 day') or die; foreach (@$progs) { ! my $t = timecvt($_->{'time'}); ! ! # Calculate the time and day of the programme ! my $time_delta = ParseDateDelta("$t:00") or die; ! my $err; ! my $prog_date = DateCalc($base_day, $time_delta, \$err); ! die "error from DateCalc(): $err" if defined $err; if (defined $prev_date and (Date_Cmp($prev_date, $prog_date) > 0)) --- 273,296 ---- die 'usage: date_programmes(ref to list of programmes, date)' if @_ != 2; ! my ($progs, $base_day) = @_; ! die 'bad base day, format should be YYYYMMDD' ! if $base_day !~ /^\d{8}$/; ! my $prev_date; my $day_later = ParseDateDelta('+1 day') or die; foreach (@$progs) { ! my $t = time12to24($_->{'time'}); ! # t('converted 12 hour time ' . d($_->{'time'}) . ' to ' . d($t)); + # $t should be hours and minutes, add seconds + $t =~ s/\b(\d\d):(\d\d)\b/$1:$2:00/ or die "bad hh:mm $t"; + # t('added seconds, time now ' . d($t)); + + my $prog_date = parse_uk_date("$base_day $t"); + die "bad base day + time '$t'" + if not defined $prog_date or $prog_date eq ''; + # t('canonical form is ' . d($prog_date)); + if (defined $prev_date and (Date_Cmp($prev_date, $prog_date) > 0)) *************** *** 269,276 **** # my $err; ! $base_day = DateCalc($base_day, $day_later, \$err); ! die "error from DateCalc(): $err" if defined $err; ! $prog_date = DateCalc($base_day, $time_delta, \$err); die "error from DateCalc(): $err" if defined $err; } --- 300,308 ---- # my $err; ! $base_day = UnixDate DateCalc($base_day, $day_later, \$err), '%Q'; die "error from DateCalc(): $err" if defined $err; + $prog_date = parse_uk_date("$base_day $t"); + die "bad base day + time '$t'" + if not defined $prog_date or $prog_date eq ''; } *************** *** 282,286 **** ! # extract_prog # # Given a programme as a ref to a list of bits of text, each with --- 314,318 ---- ! # extract_prog() # # Given a programme as a ref to a list of bits of text, each with *************** *** 298,301 **** --- 330,345 ---- $t =~ s/^\s+//; $t =~ s/\s+$//; next if $t eq ''; + # Clean up some of the mess from the HTML + $t =~ s/\xa3((?:\d|,)*)/($1 ne '') ? "$1 pounds" : ''/ge; + $t =~ s/\Q \E/ /g; + + # XML::Simple turns '&' into '&', but nsgmls -wxml doesn't + # like this. Kludge round the problem by getting rid of '&' + # altogether. + # + $t =~ s/\Q\&\;\E/ and /g; + $t =~ s/\Q&\E/ and /g; + + # t("got bit of text '$t', bold=$b, italic=$i"); if ($b and not $i and istime($t)) { die "time already set to $time but $t found" *************** *** 329,333 **** } elsif ($t =~ /^Director: (.+)\.$/) { ! die "italic text $t found, but director already defined" if defined $director; $director = $t; --- 373,377 ---- } elsif ($t =~ /^Director: (.+)\.$/) { ! warn "italic text $t found, but director already defined - ignoring", next if defined $director; $director = $t; *************** *** 335,339 **** else { # Must be sub-title. ! die "italic text $t found, but sub-title already defined" if defined $sub_title; $sub_title = $t; --- 379,383 ---- else { # Must be sub-title. ! warn "italic text $t found, but sub-title already defined - ignoring", next if defined $sub_title; $sub_title = $t; *************** *** 359,369 **** $title = '(unknown title)' if not defined $title; - if (defined $desc) { - # Clean up some of the mess from the HTML - $desc =~ s/\xa3((?:\d|,)*)/($1 ne '') ? "$1 pounds" : ''/ge; - $desc =~ s/ / /g; - $desc =~ s/&/ & /g; - } - return { time => $time, title => $title, sub_title => $sub_title, desc => $desc }; --- 403,406 ---- *************** *** 387,392 **** use HTML::TokeParser; my $p = new HTML::TokeParser(\$html) or die; - my @r = (); my ($bold, $it) = (0, 0); while (my $t = $p->get_token()) { --- 424,435 ---- use HTML::TokeParser; my $p = new HTML::TokeParser(\$html) or die; + # HTML::TokeParser is based on HTML::Parser, and has the same + # tendency to break chunks of text into multiple tokens. Turn + # that off. + # + $p->unbroken_text(1); + + my @r = (); my ($bold, $it) = (0, 0); while (my $t = $p->get_token()) { *************** *** 454,468 **** die 'usage: istime(possible time string)' if @_ != 1; local $_ = shift; return /^(\d\d?)[.:]?(\d\d)(am|pm)$/; } ! # timecvt() # # Convert a 12 hour time to 24 hour. # ! sub timecvt($) { ! die 'usage: timecvt(12 hour time string)' if @_ != 1; local $_ = shift; s/\s+//; my ($hours, $mins, $ampm) = /^(\d\d?)[.:]?(\d\d)(am|pm)$/ --- 497,521 ---- die 'usage: istime(possible time string)' if @_ != 1; local $_ = shift; + + my $tz = gettz($_); + s/\Q$tz\E// if defined $tz; + + s/\s+//g; return /^(\d\d?)[.:]?(\d\d)(am|pm)$/; } ! # time12to24() # # Convert a 12 hour time to 24 hour. # ! sub time12to24($) { ! die 'usage: time12to24(12 hour time string)' if @_ != 1; local $_ = shift; + + # Remove the timezone and stick it back on afterwards. + my $tz = gettz($_); + s/\Q$tz\E// if defined $tz; + s/\s+//; my ($hours, $mins, $ampm) = /^(\d\d?)[.:]?(\d\d)(am|pm)$/ *************** *** 487,492 **** } else { die } ! ! return sprintf('%02d:%02d', $hours, $mins); } --- 540,547 ---- } else { die } ! ! my $r = sprintf('%02d:%02d', $hours, $mins); ! $r .= " $tz" if defined $tz; ! return $r; } *************** *** 494,497 **** --- 549,555 ---- # get_date_from_page() # + # Returns date in 'YYYYMMDD' format from Ananova page, or undef if + # none found. + # sub get_date_from_page($) { die 'usage: get_date_from_page(html string)' if @_ != 1; *************** *** 505,510 **** die "date already set to $date, but headline $text found" if defined $date; ! $date = ParseDate($text) or die "bad date string $text\n"; } } --- 563,569 ---- die "date already set to $date, but headline $text found" if defined $date; ! my $pd = ParseDate($text) or die "bad date string $text\n"; + $date = UnixDate($pd, '%Q'); } } *************** *** 528,543 **** = @$p{qw(channel date end title sub_title desc director)}; if (defined $end) { ! $w->startTag('programme', start => $start, ! stop => $end, channel => $channel ); } else { ! $w->startTag('programme', start => $start, channel => $channel ); } $w->dataElement('title', $title, lang => $LANG); ! $w->dataElement('sub_title', $sub_title, lang => $LANG) if defined $sub_title; --- 587,603 ---- = @$p{qw(channel date end title sub_title desc director)}; + # The dates are converted to the appropriate timezone for output. if (defined $end) { ! $w->startTag('programme', start => join(' ', @{date_to_uk($start)}), ! stop => join(' ', @{date_to_uk($end)}), channel => $channel ); } else { ! $w->startTag('programme', start => join(' ', @{date_to_uk($start)}), channel => $channel ); } $w->dataElement('title', $title, lang => $LANG); ! $w->dataElement('sub-title', $sub_title, lang => $LANG) if defined $sub_title; Index: listings_to_latex =================================================================== RCS file: /cvsroot/xmltv/xmltv/listings_to_latex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** listings_to_latex 2001/11/02 17:58:43 1.1 --- listings_to_latex 2001/11/02 18:07:18 1.2 *************** *** 25,28 **** --- 25,29 ---- use IO::File; use Date::Manip; + require 'tz.pl'; die "usage: $0 [filename]" if @ARGV >= 2; *************** *** 42,46 **** my $xml; if (@ARGV == 1) { ! $xml = XMLin($ARGV[0], cache => [ 'storable' ]); } elsif (@ARGV == 0) { --- 43,47 ---- my $xml; if (@ARGV == 1) { ! $xml = XMLin($ARGV[0], cache => [ 'storable' ], searchpath => '.'); } elsif (@ARGV == 0) { *************** *** 52,56 **** my @chunks = chunk(30, @programmes); ! my $curr_date; foreach (@chunks) { my @programmes = @$_; --- 53,57 ---- my @chunks = chunk(30, @programmes); ! my ($curr_date, $curr_tz); foreach (@chunks) { my @programmes = @$_; *************** *** 68,72 **** my ($start, $stop, $channel) = @h{qw(start stop channel)}; my $title = $h{title}->{content}; ! my $sub_title = $h{sub_title}->{content}; die 'no start' if not defined $start; --- 69,73 ---- my ($start, $stop, $channel) = @h{qw(start stop channel)}; my $title = $h{title}->{content}; ! my $sub_title = $h{'sub-title'}->{content}; die 'no start' if not defined $start; *************** *** 75,80 **** die 'no channel' if not defined $channel; ! # Convert date-and-time to just hhmm ! foreach ($start, $stop) { s/^\d{8}(\d\d):(\d\d):00$/$1$2/ } # Hardcoded channel lookup --- 76,102 ---- die 'no channel' if not defined $channel; ! # Convert date-and-time to just hhmm, adding explicit timezone ! # whenever it changes. ! # ! foreach (\$start, \$stop) { ! my $p = ParseDate($$_) or die "bad date $$_"; ! my $tz = gettz($$_) || 'UT'; ! $$_ = UnixDate($p, '%R'); ! ! if (not defined $curr_tz) { ! # First date on this page. Just assume it doesn't ! # need printing (FIXME). ! # ! $curr_tz = $tz; ! } ! elsif ($curr_tz ne $tz) { ! # Add timezone to printed hh:mm ! $$_ .= " $tz"; ! $curr_tz = $tz; ! } ! else { ! # Timezone hasn't changed, don't print it again ! } ! } # Hardcoded channel lookup *************** *** 125,135 **** sub start_date($) { my $prog = shift; ! die "bad programme: " . d($prog) if not defined $prog->{title}; die "no start date for $prog->{title}" if not defined $prog->{start}; ! local $_ = $prog->{start}; ! /^(\d{8})/ or die "bad date $_"; ! return $1; } --- 147,162 ---- + # start_date() + # + # Returns the day on which a programme starts, in the form YYYYMMDD. + # sub start_date($) { my $prog = shift; ! die "bad programme" if not defined $prog->{title}; die "no start date for $prog->{title}" if not defined $prog->{start}; ! ! my $p = ParseDate($prog->{start}); ! die "bad start date for programme" if not defined $p or $p eq ''; ! return UnixDate($p, '%Q'); } Index: pick_cgi =================================================================== RCS file: /cvsroot/xmltv/xmltv/pick_cgi,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pick_cgi 2001/11/02 17:58:43 1.1 --- pick_cgi 2001/11/02 18:07:18 1.2 *************** *** 81,87 **** use XML::Simple; use Fcntl ':flock'; - use Dbg; $Dbg::On = 0; $Dbg::As_HTML = 1; use Date::Manip; ! ######## --- 81,86 ---- use XML::Simple; use Fcntl ':flock'; use Date::Manip; ! #use Dbg; $Dbg::On = 0; $Dbg::As_HTML = 1; ######## *************** *** 136,140 **** seek PREFS, 0, 0; while (<PREFS>) { ! t("got line from $PREFS_FILE: " . d($_)); s/^\s+//; s/\s+$//; s/\#.*//; --- 135,139 ---- seek PREFS, 0, 0; while (<PREFS>) { ! # t("got line from $PREFS_FILE: " . d($_)); s/^\s+//; s/\s+$//; s/\#.*//; *************** *** 145,149 **** else { die "$PREFS_FILE:$.: bad line (remnant is $_)\n" } } ! t('\%wanted=' . d(\%wanted)); my ($skip, $next) = (url_param('skip'), url_param('next')); --- 144,148 ---- else { die "$PREFS_FILE:$.: bad line (remnant is $_)\n" } } ! #t('\%wanted=' . d(\%wanted)); my ($skip, $next) = (url_param('skip'), url_param('next')); *************** *** 151,155 **** die "bad URL parameter $_" if defined and tr/0-9//c; } ! t('$skip=' . d($skip) . ', $next=', d($next)); if (defined $skip and defined $next) { --- 150,154 ---- die "bad URL parameter $_" if defined and tr/0-9//c; } ! #t('$skip=' . d($skip) . ', $next=', d($next)); if (defined $skip and defined $next) { *************** *** 278,282 **** my $val = param("prog$i"); my $title = $programmes[$i]->{title}->{content}; ! if ($wanted{$title} eq 'always' or $val eq 'yes') { print TOWATCH "$LISTINGS/$i\n"; print br(), "Planning to watch $title\n"; --- 277,283 ---- my $val = param("prog$i"); my $title = $programmes[$i]->{title}->{content}; ! if ((defined $wanted{$title} and $wanted{$title} eq 'always') ! or (defined $val and $val eq 'yes') ) ! { print TOWATCH "$LISTINGS/$i\n"; print br(), "Planning to watch $title\n"; *************** *** 403,412 **** # sub print_date_for($$;) { ! local $Dbg::On = 0; die 'usage: print_date_for(programme, [prev programme])' unless 1 <= @_ and @_ < 3; my ($prog, $prev) = @_; ! t('$prog=' . d($prog)); ! t('$prev=' . d($prev)); my $DAY_FMT = '%A'; # roughly as for date(1) --- 404,413 ---- # sub print_date_for($$;) { ! # local $Dbg::On = 0; die 'usage: print_date_for(programme, [prev programme])' unless 1 <= @_ and @_ < 3; my ($prog, $prev) = @_; ! # t('$prog=' . d($prog)); ! # t('$prev=' . d($prev)); my $DAY_FMT = '%A'; # roughly as for date(1) *************** *** 414,419 **** my $day = UnixDate($prog->{start}, $DAY_FMT); my $prev_day = defined $prev ? UnixDate($prev->{start}, $DAY_FMT) : undef; ! t('$day=' . d($day)); ! t('$prev_day=' . d($prev_day)); if ((not defined $prev_day) or ($day ne $prev_day)) { --- 415,420 ---- my $day = UnixDate($prog->{start}, $DAY_FMT); my $prev_day = defined $prev ? UnixDate($prev->{start}, $DAY_FMT) : undef; ! # t('$day=' . d($day)); ! # t('$prev_day=' . d($prev_day)); if ((not defined $prev_day) or ($day ne $prev_day)) { Index: xmltv.dtd =================================================================== RCS file: /cvsroot/xmltv/xmltv/xmltv.dtd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** xmltv.dtd 2001/11/02 17:58:43 1.1 --- xmltv.dtd 2001/11/02 18:07:18 1.2 *************** *** 1,9 **** <!-- DTD for TV listings ! This is a first draft of a DTD to represent a TV listing. Rather than ! breaking the listing up by channel, it mixes all the channels ! together. Data about a TV programme are stored in the subelements of ! element 'programme', but metadata such as when it will be broadcast ! are stored as attributes. Many of the programme details have a 'lang' attribute so that you can --- 1,9 ---- <!-- DTD for TV listings ! This is a DTD to represent a TV listing. Rather than breaking the ! listing up by channel, it mixes all the channels together. Data about ! a TV programme are stored in the subelements of element 'programme', ! but metadata such as when it will be broadcast are stored as ! attributes. Many of the programme details have a 'lang' attribute so that you can *************** *** 37,41 **** With thanks to Gottfried Szing and others for suggestions. ! Ed Avis, ep...@do..., 2000-06-23 --> --- 37,48 ---- With thanks to Gottfried Szing and others for suggestions. ! All dates and times in this DTD follow the same format, loosely based ! on ISO 8601. They can be 'YYYYMMDDhhmmss' or some initial ! substring, for example if you only know the year and month you can ! have 'YYYYMM'. You can also append a timezone to the end; if no ! explicit timezone is given, UT is assumed. Examples: ! '200007281733 BST', '200209', '19880523083000 +0300'. (BST == +0100.) ! ! Ed Avis, ep...@do..., 2000-07-28 --> *************** *** 74,78 **** programmes on the same channel. --> ! <!ELEMENT programme (title+, sub_title*, desc*, credits?, date?, category*, language?, orig-language?, length?, url*, country*, episode-num? )> --- 81,85 ---- programmes on the same channel. --> ! <!ELEMENT programme (title+, sub-title*, desc*, credits?, date?, category*, language?, orig-language?, length?, url*, country*, episode-num? )> *************** *** 91,96 **** To do: part number for multi-part episodes. --> ! <!ELEMENT sub_title (#PCDATA)> ! <!ATTLIST sub_title lang CDATA #IMPLIED> <!-- Description of the programme or episode. --- 98,103 ---- To do: part number for multi-part episodes. --> ! <!ELEMENT sub-title (#PCDATA)> ! <!ATTLIST sub-title lang CDATA #IMPLIED> <!-- Description of the programme or episode. *************** *** 118,124 **** <!-- The date the programme or film was finished. This will probably ! be the same as the copyright date. The format is YYYYMMDDhhmmss, or ! some initial substring of that (eg YYYYMM if you only know to the ! nearest month). --> <!ELEMENT date (#PCDATA)> --- 125,129 ---- <!-- The date the programme or film was finished. This will probably ! be the same as the copyright date. --> <!ELEMENT date (#PCDATA)> |