xmltv/grab/fi/fi/source telkku.pm,2.01,2.02

Stefan Becker <[email protected]>
Newsgroups gmane.comp.tv.xmltv.cvs
Message-ID <[email protected]>
Update of /cvsroot/xmltv/xmltv/grab/fi/fi/source
In directory vz-cvs-3.sog:/tmp/cvs-serv11698/grab/fi/fi/source

Modified Files:
	telkku.pm 
Log Message:
- telkku: update for site changes (Bug #3575204)
- test: update test configuration


Index: telkku.pm
===================================================================
RCS file: /cvsroot/xmltv/xmltv/grab/fi/fi/source/telkku.pm,v
retrieving revision 2.01
retrieving revision 2.02
diff -C2 -d -r2.01 -r2.02
*** telkku.pm	10 Oct 2011 16:38:57 -0000	2.01
--- telkku.pm	10 Oct 2012 20:36:30 -0000	2.02
***************
*** 36,40 ****
      # Channel list can be found from the left sidebar
      #
!     # <div id="channelList">
      #   ...
      #   <ul>
--- 36,40 ----
      # Channel list can be found from the left sidebar
      #
!     # <div class="l-wrap l-grid--16" id="channelContainer">
      #   ...
      #   <ul>
***************
*** 47,51 ****
      # </div>
      #
!     if (my $container = $root->look_down("id" => "channelList")) {
        if (my @list = $container->find("li")) {
  	debug(2, "Source telkku.com found " . scalar(@list) . " channels");
--- 47,51 ----
      # </div>
      #
!     if (my $container = $root->look_down("id" => "channelContainer")) {
        if (my @list = $container->find("li")) {
  	debug(2, "Source telkku.com found " . scalar(@list) . " channels");
***************
*** 155,162 ****
      # All program info is contained within a unsorted list with class "programList"
      #
!     #  <ul class="programList">
      #   <li>
!     #    <span class="programDate"><a href="http://www.telkku.com/program/show/2010112621451">23:45&nbsp;Uutisikkuna</a></span><br />
!     #    <span class="programDescription">...</span>
      #   </li>
      #   ...
--- 155,168 ----
      # All program info is contained within a unsorted list with class "programList"
      #
!     #  <ul class="l-stack programList">
      #   <li>
!     #    <a class="program" href="http://www.telkku.com/program/show/2012100920451">
!     #     <div class="theme-hr program__content">
!     #      <div class="program__desc">
!     #       <div class="h4 program__title">23:45&nbsp;Uutisikkuna</div>
!     #       <div class="progrram__desc">...</div>
!     #      </div>
!     #     </div>
!     #    </a>
      #   </li>
      #   ...
***************
*** 164,196 ****
      #
      my $opaque = startProgrammeList();
!     if (my $container = $root->look_down("class" => "programList")) {
        if (my @list = $container->find("li")) {
  	foreach my $list_entry (@list) {
! 	  my $date = $list_entry->look_down("class", "programDate");
! 	  my $desc = $list_entry->look_down("class", "programDescription");
! 	  if ($date && $desc) {
! 	    my $link = $date->find("a");
! 	    if ($link) {
  
! 	      # Extract texts from HTML elements. Entities are already decoded.
! 	      $date = $link->as_text();
! 	      $desc = $desc->as_text();
  
! 	      # Use "." to match &nbsp; character (it's not included in \s?)
! 	      if (my($hour, $minute, , $title) =
! 		  $date =~ /^(\d{2}):(\d{2}).(.+)/) {
! 		my $href     = $link->attr("href");
! 		my $category = (defined($href) && exists($movie_ids->{$href})) ?
! 		    "elokuvat" : undef;
  
! 		debug(3, "List entry $channel ($hour:$minute) $title");
! 		debug(4, $desc);
! 		debug(4, $category) if defined $category;
  
! 		# Only record entry if title isn't empty
! 		appendProgramme($opaque, $hour, $minute, $title, $category,
! 				$desc)
! 		  if length($title) > 0;
! 	      }
  	    }
  	  }
--- 170,201 ----
      #
      my $opaque = startProgrammeList();
!     if (my $container = $root->look_down("class" => "l-stack programList")) {
        if (my @list = $container->find("li")) {
  	foreach my $list_entry (@list) {
! 	  my $link  = $list_entry->look_down("class", "program");
! 	  my $title = $list_entry->look_down("class", "h4 program__title");
! 	  my $desc  = $list_entry->look_down("class", "progrram__desc");
! 	  if ($link && $title && $desc) {
! 	    my $date;
  
! 	    # Extract texts from HTML elements. Entities are already decoded.
! 	    $date = $title->as_text();
! 	    $desc = $desc->as_text();
  
! 	    # Use "." to match &nbsp; character (it's not included in \s?)
! 	    if (my($hour, $minute, $title) =
! 		$date =~ /^(\d{2}):(\d{2}).(.+)/) {
! 	      my $href     = $link->attr("href");
! 	      my $category = (defined($href) && exists($movie_ids->{$href})) ?
! 		  "elokuvat" : undef;
  
! 	      debug(3, "List entry $channel ($hour:$minute) $title");
! 	      debug(4, $desc);
! 	      debug(4, $category) if defined $category;
  
! 	      # Only record entry if title isn't empty
! 	      appendProgramme($opaque, $hour, $minute, $title, $category,
! 			      $desc)
! 		if length($title) > 0;
  	    }
  	  }


------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.