Changeset 679
- Timestamp:
- 05/23/07 18:26:09 (6 years ago)
- Files:
-
- 2 modified
-
grabbers/abc_website (modified) (5 diffs)
-
status (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
grabbers/abc_website
r674 r679 22 22 23 23 my $progname = "abc_website"; 24 my $version = "3.0 1";24 my $version = "3.02"; 25 25 26 26 use LWP::UserAgent; … … 292 292 my $unprocessed_programmes = 0; 293 293 my $stop_fetching = 0; 294 my @unprocessed_progname, my @unprocessed_starttime, my @unprocessed_url ;294 my @unprocessed_progname, my @unprocessed_starttime, my @unprocessed_url, my @unprocessed_day; 295 295 296 296 my $to_skip = $opt_offset; … … 391 391 $unprocessed_progname[$unprocessed_programmes] = $programme; 392 392 $unprocessed_starttime[$unprocessed_programmes] = $found_time; 393 $unprocessed_day[$unprocessed_programmes] = $daynum; 393 394 $unprocessed_url[$unprocessed_programmes] = "http://www.abc.net.au".$progurl; 394 395 $unprocessed_programmes++; … … 414 415 $unprocessed_progname[$unprocessed_programmes] = "Station Close"; 415 416 $unprocessed_starttime[$unprocessed_programmes] = $station_close_data->{$xmlid}->[$daynum]; 417 $unprocessed_day[$unprocessed_programmes] = $daynum; 416 418 $unprocessed_url[$unprocessed_programmes] = ""; 417 419 $unprocessed_programmes++; 418 } else {419 # throw away last programme from each day - we can't use it as420 # we don't have a 'stop' time for it421 422 printf "throwing away '%s' (%s) because we won't have a valid stop time\n",423 $unprocessed_progname[$unprocessed_programmes-1],424 POSIX::strftime("%Y%m%d%H%M", localtime($unprocessed_starttime[$unprocessed_programmes-1]))425 if $debug;426 $unprocessed_progname[$unprocessed_programmes-1] = "";427 420 } 428 421 } else { … … 440 433 441 434 for (my $i = 0; $i < ($unprocessed_programmes-1); $i++) { 442 next if ($unprocessed_progname[$i] eq ""); 435 # if we've found a programme which is between days, evaluate whether we can 436 # use it or need to drop it (because we won't necessarily have a 'stop' time 437 if (($unprocessed_day[$i] != $unprocessed_day[($i+1)]) && 438 ($unprocessed_progname[$i] ne "Station Close")) { 439 # we'd normally throw away last programme from each day - we can't use it 440 # as we don't have a 'stop' time for it. 441 # with some ABC programming, ABC no longer indicate any station close 442 # on some days - they're broadcasting 24 hours. 443 # only throw away the last programme if: 444 # 1. it is seen to run longer than 3.5 hours 445 # 2. it is a different title 446 if ((($unprocessed_starttime[$i+1] - $unprocessed_starttime[$i]) > (3.5*3600)) && 447 ($unprocessed_progname[$i] ne $unprocessed_progname[$i+1])) { 448 printf "throwing away '%s' (%s) because we won't have a valid stop time (%s) and title is different (%s)\n", 449 $unprocessed_progname[$i], 450 POSIX::strftime("%Y%m%d%H%M", localtime($unprocessed_starttime[$i])), 451 POSIX::strftime("%Y%m%d%H%M", localtime($unprocessed_starttime[$i+1])), 452 $unprocessed_progname[$i+1] 453 if $debug; 454 next; 455 } 456 } 443 457 444 458 # if we are micro-gap fetching, only include programmes which match our micro gaps -
status
r678 r679 2 2 grabber yahoo7widget 1.83-r1 3 3 grabber rex 3.4.10 4 grabber abc_website 3.0 1-r14 grabber abc_website 3.02 5 5 grabber sbsnews_website 0.14 6 6 grabber oztivo 0.29
