Changeset 1283
- Timestamp:
- 07/02/10 17:14:20 (23 months ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
grabbers/southerncross_website (modified) (7 diffs)
-
status (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/grabbers/southerncross_website
r1208 r1283 34 34 35 35 my $progname = "southerncross_website"; 36 my $version = "0. 21";36 my $version = "0.99"; 37 37 38 38 #use LWP::UserAgent; … … 279 279 # From http://www.southerncrossbroadcasting.com.au/TVGuide 280 280 my $channel; 281 my $url = "http://www.southerncrossbroadcasting.com.au/TVGuide/eguide.asp?ch="; 281 # my $url = "http://www.southerncrossbroadcasting.com.au/TVGuide/eguide.asp?ch="; 282 my $url = "http://www.scmedia.com.au/content/eguide.aspx?ch="; 283 282 284 283 285 # non "Sthn Cross TEN" has different page layout (all Capitals, (year)) … … 559 561 560 562 my @table_rows = $tree->find_by_tag_name('table'); 561 if (@table_rows < 2) {563 if (@table_rows < 1) { 562 564 &log("Format has changed for url '$url'"); 563 565 $stats{bad_html}++; … … 566 568 567 569 my $progs_in_day = 0; 568 my @tds = $table_rows[1]->find_by_tag_name('td'); # from second table 570 my @tds = $table_rows[0]->find_by_tag_name('td'); 571 foreach (@tds) 572 { 573 print " - " . $_->as_trimmed_text() . "\n"; 574 } 569 575 my $td = shift @tds; 570 576 my $text = $td->as_trimmed_text() if $td; … … 582 588 POSIX::strftime("%Y%m%d%H%M", localtime($prog->{start}))) 583 589 if $opt->{debug}; 590 584 591 $td = shift @tds || last; 585 $text = $td->as_trimmed_text(); 586 587 next if (not $text); # title 588 my $b = $td->find_by_tag_name('b') || next; 589 my $title = $b->as_trimmed_text(); 590 my $subtitle = $b->right(); 591 $subtitle =~ s/ - // if $subtitle; 592 my $title = $td->as_trimmed_text(); 593 594 $td = shift @tds || last; 595 my $rating = &Shepherd::Common::subrating($td->as_trimmed_text()); 596 &log("parse_page debug: rating : $rating") if $opt->{debug}; 597 598 $td = shift @tds || last; 599 $td = shift @tds || last; 600 my $text = $td->as_trimmed_text(); 601 592 602 # <b>Saturday Late Night Movie</b> - Run Lola Run 593 603 # <b>Sunday Afternoon Premiere Movie</b> - Rat 594 604 # <b>Sunday Afternoon Movie</b> - Evolution 595 my ( $rating,%type);605 my (%type); 596 606 my $post_desc=""; 597 if ($ subtitle and $title =~ /^(Friday|Saturday|Sunday) .* Movie$/i) {607 if ($title =~ /^(Friday|Saturday|Sunday) .* Movie$/i) { 598 608 $type{movie} = 1; 599 609 $type{premiere} = 1 if ($title =~ /Premiere/i); 600 &log("parse_page debug: Changing title $title to $subtitle")601 if $opt->{debug};602 $post_desc .= "($title)";603 $title = $subtitle;604 $subtitle = undef;605 610 } 606 611 # (Network Premiere) … … 625 630 $type{repeat} = 1 if ($tag =~ /(^|\W)Replay(\W|$)/i); 626 631 } 627 $type{live} = 1 if ($subtitle and $subtitle =~ /live from/i);628 632 $prog->{title} = [[$title, $opt->{lang}]]; 629 633 &log("parse_page debug: title : $title $post_desc") if ($opt->{debug}); 630 if ($subtitle) { 631 $prog->{'sub-title'} = [[$subtitle, $opt->{lang}]]; 632 &log("parse_page debug: sub-title : $subtitle") if $opt->{debug}; 633 } 634 $td = shift @tds || goto PART; 635 $text = $td->as_trimmed_text(); 636 637 if ($text) { # rating 638 $rating = $text; 639 &log("parse_page debug: rating : $text") if $opt->{debug}; 640 } 641 $td = shift @tds || goto PART; 642 $text = $td->as_trimmed_text(); 643 644 if ($text eq chr(160)) { # 645 $td = shift @tds || goto PART; 646 $text = $td->as_trimmed_text(); 647 648 if ($text) { 634 635 if ($text) { 649 636 # - Live from Aurora 650 637 # Hosted by Mike Goldman & Bree Amer, this ... # how to parse all … … 666 653 $prog->{desc} = [[$text, $opt->{lang}]] if $text; # desc 667 654 &log("parse_page debug: desc : $text") if $opt->{debug}; 668 } 669 $td = shift @tds || goto PART; 670 $text = $td->as_trimmed_text(); 671 672 goto PART if ($text ne chr(160)); # 673 $td = shift @tds || goto PART; 674 $text = $td->as_trimmed_text(); 675 } 676 677 if ($text eq "" and not $td->attr('colspan')) { 678 $td = shift @tds || goto PART; 679 $text = $td->as_trimmed_text(); 680 681 if ($text) { # verbose rating 682 $post_desc .= $text; 683 if ($rating) { 684 $rating .= " " . &Shepherd::Common::subrating($text); 685 } else { 686 $rating = &Shepherd::Common::subrating($text); 687 } 688 &log("parse_page debug: verbose rating : $text") if $opt->{debug}; 689 } 690 $td = shift @tds || goto PART; 691 $text = $td->as_trimmed_text(); 692 693 goto PART if ($text ne "" or $td->attr('colspan')); # 694 $td = shift @tds || goto PART; 695 $text = $td->as_trimmed_text(); 696 } 655 } 656 697 657 PART: 698 658 my $category = category_from_title($title); -
trunk/status
r1282 r1283 11 11 grabber yahoo7widget 2.13 12 12 grabber foxtel_swf 2.03 13 grabber southerncross_website 0.2114 13 grabber ten_website 2.10 15 14 grabber citysearch 3.0.1-r5
