#481 No data for telkku.com tv_grab_fi grabber

closed-duplicate
tv_grab_fi (30)
5
2012-11-25
2012-11-25
mteppo
No

telkku.com seems to have changed the format and thusly tv_grab_fi does not return any data.

Discussion

  • mteppo

    mteppo - 2012-11-25

    Very un-elegant patch to the script (which seems to be generated somehow) itself that may help you on figuring out what should be done:
    namely the program-list container class was renamed as well as some changes on the list items.

    <code>

    # Grab one day
    sub grab {
    my($self, $id, $yesterday, $today, $tomorrow, $offset) = @_;

    # Get channel number from XMLTV id
    return unless my($channel) = ($id =~ /^(\d+)\.telkku\.com$/);

    # Fetch & parse HTML
    my $root = fetchTree("http://www.telkku.com/channel/list/$channel/$today");
    if ($root) {
    my $movie_ids = _getMovieIDsForOffset($offset);

    #
    # 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/2012112321053">
    # <div class="theme-hr program__content">
    # <div class="program__desc">
    # <div class="h4 program__title">23:05&nbsp;Southland Tales</div>
    # <div class="progrram__desc">Ydiniskujen jälkeinen Yhdysvallat
    # keikkuu talous- ja ympäristökatastrofin partaalla. Toimintatähti Boxer Santaros ...
    # Yhdysvallat 2006. (155 #min.) </div>
    # </div>
    # </div>
    # </a>
    # </li>
    # <li> # <ul class="l-stack 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>
    # ...
    # </ul>
    #
    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 $date = $list_entry->look_down("class", "h4 program__title");
    # my $prog_title = $list_entry->look_down("class", "h4 program__title");
    my $desc = $list_entry->look_down("class", "progrram__desc");
    debug(1, "date '$date', desc '$desc'");
    if ($date && $desc ) {
    my $link = $date; #$date->find("a");
    debug(1, "link '$link'");
    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(1, "List entry $channel ($hour:$minute) $title");
    debug(1, $desc);
    debug(1, $category) if defined $category;

    # Only record entry if title isn't empty
    appendProgramme($opaque, $hour, $minute, $title, $category,
    $desc)
    if length($title) > 0;
    }
    }
    }
    }
    }
    }

    # Done with the HTML tree
    $root->delete();

    </code>

     
  • Stefan Becker

    Stefan Becker - 2012-11-25
    • status: open --> closed-duplicate
     
  • Stefan Becker

    Stefan Becker - 2012-11-25

    Please always update to the latest release version or development version from SF CVS (whatever is newer) and reproduce the problem with that version, before filing a bug - in order not to waste time and bandwidth. Kindly also always include version numbers with your bug report. Thank you/Kiitos.

    Duplicate of bug #3575204. Fixed in telkku.pm 2.02 2012/10/10 20:36:30

     
  • Stefan Becker

    Stefan Becker - 2012-11-25

    This artifact has been marked as a duplicate of artifact 3575204 with reason:
    Patch shows same changes that are already in CVS version

     

Log in to post a comment.