Page 1 of 4 123 ... LastLast
Results 1 to 15 of 46

Thread: Jpag'alike script generation

  1. #1
    Join Date
    Jun 2001
    Posts
    70

    Jpag'alike script generation

    I am curious how many people are actually working on this, what state everyone's stuff is in and how much work is left

    My version of the tvguide.pl script generates most of the addShows section but I don't have any of the addChannel section anymore. I haven't looked at the detail section yet. I am only handling the current date and not handling the case where the time asked for crosses into the next day.

    TVguide.com seems to be testing a new layout for their page lately so I don't know if this script will continue to work without modification.

  2. #2
    Join Date
    Jun 2001
    Posts
    70
    I just noticed a problem with the tvguide perl script. This problem lies in its span time slots operation. I noticed in my output I am getting shows chopped into two pieces depending on where they lie on the time line. I don't know what kind of problems this would cause if this data were input into the tivo. If the show lies completely within a time block it will not be chopped up. It does get the duration correct, but only if you add the two pieces together.

    If anyone has a quick fix for this problem it would be nice.

  3. #3
    Join Date
    Jun 2001
    Posts
    41
    Remember, we are modifying the script so that it will get 7-14 days worth of data. So start your script so that it always pulls data starting at 12:00am or 00:00 military time. It will pull in 2 hour increments. This is ok. If the title has "<<" at the beginning, drop it. Who cares about data from the day before we started the data collection.

    Now as far as details collection. Once you have an array with the channels, title etc... You can call "show_detail()" sub on each title in the array. Only problem is that this sub also calls "load_data($url)" which also stores the data in $tvg::INPUT where the time grid is originally stored and you need this data to get the new data. We have to create $tvg::DETAILINPUT and parse that for show detail. You can get the show duration in the details, just round up to nearest hour/half hour. Hmmmm or not.....Maybe not a good idea to round up.
    Last edited by sir_lunatic; 06-30-2001 at 12:52 AM.

  4. #4
    Join Date
    Jun 2001
    Posts
    70
    Show duration isn't a problem, I can already get that reliably. The problem is getting the show's starting time . Without that the rest of the details are worthless. Unfortunately it doesn't seem like the html code contains the actual start imes of the shows. The details do however, but they may contain more than one show date.

    The script actually retrieves data in 2 hour chunks. If you tell it 24 hours of time, it actually does 12 retrieves of the website data. The merge listings subroutine is supposed to merge all the shows that break these two hour chunks back together, however it seems to be broken.
    The problem that happens with this is that say you have a movie that starts at 1pm. Now since its a 2 hour movie it breaks the 2 hour barrier. You end up with the first hour of the movie as the first "show" and the second part of the movie as the second "show". So you get two entries for the one show. I am working on a method to solve this though.

    I just realized I said what you said again. Oops.


    It blows my mind how many views this thread and the one it started in are getting.
    Last edited by stryder; 06-30-2001 at 01:36 AM.

  5. #5
    Join Date
    Jun 2001
    Posts
    6
    Following the thread, going to be working on it.
    Mere rabbit so far, but once I come up to speed with this sucker I promise to help!
    20+ years of Database experience, if we can't crack MFS I'll be surprised .
    Bear (bare??, whatever (sp!)) with me! Stick with it, we're doing good so far, Rome wasn't built in a day!!

    Dino
    (goddam typo's, never post after > 2 bottles of wine!!)
    Last edited by Dinosaur; 06-30-2001 at 12:28 PM.

  6. #6
    Join Date
    Jun 2001
    Posts
    41
    I may have found a start to getting the start time.

    towards the end of "sub parse_shows" you will see a line:

    #print "[$_]<$tabs>\n";

    uncomment this line; remove the "#", save and run the script

    It will print out each channel line, followed by each show on the line and how many tab spaces it occupys in the final output.

    Per this script, it will only show 2 hours per screen, and per the comments in this script, he uses 24 tabs per line equating to 5 minutes per tab.

    So if the start time for this first page is 00:00 and the first channel has two shows, the first occupying 6 tabs and the second 18 tabs, 6 times 5 equals 30 minutes, the second show starts at 00:30.

    Do what I said above and look at the output, you will understand when you see it.

  7. #7
    Join Date
    Jul 2001
    Location
    Somerville, MA
    Posts
    15

    Lightbulb New version of tvguide out.

    Just to give you guys a heads up. Supposedly works with the new version of the tvguide site:

    http://www.cherrynebula.net/projects...de/tvguide.php

    Ps. I should bet getting a refurb 312 this week. I will start on working on this project as soon as I get the hardware in. Enjoy.

  8. #8
    Join Date
    Jun 2001
    Posts
    70
    Cool thanks for the tip I will give it a shot and see what it does differently. On another note I seemed to have screwed up my tivo partition, so I am now attempting a restore from backup.

  9. #9
    Join Date
    Jun 2001
    Posts
    41
    ok to get start time:

    I started with an unmodified tvguide script.

    replace "sub print_layout" with the following:

    --------cut here --------
    sub print_layout
    {
    return if ($#tvg::listings < 0);

    my ($x, $st, $ch);

    print "\n";

    foreach $x (@tvg::listings) {
    my ($l,$slots) = split(/#/,$x);

    if ($slots == 0) {
    $st = 0;
    $ch = $l;
    next;
    }
    print "$ch,$l," , $st * 5 ,",", $slots * 5 , "\n";
    $st = $st + $slots;
    }
    }
    --------cut here----------

    i ran it the following way

    ./tvguide -span 24 -date 07/03 -time 00:00 > listing

    this yields channel,title,epoch time in min, length in min

    the epoch is from the time in minutes the guide starts.

    I now see that the title of the shows is going to have to be retrieved from the details due to a truncating problem with cells on tvguides web sight being too small.

  10. #10
    Join Date
    Jun 2001
    Posts
    41
    Now as far as the problem of the show splits, we would need to get the real show title from detail, as well as length from detail.

    Check to see if a show appears twice in adjacent time slots and compare their length to the one retrieved in detail, if they are smaller, they need to be combined as one entry.

    loop,loop,loop..........

    shouldn't be too bad.

  11. #11
    Join Date
    Jun 2001
    Posts
    70
    I am going to add your changes to my version of the file. I modified the print_channel_line function. It allowed me to print out the show numbers. I also used a perl module called Calc::Date

  12. #12
    Join Date
    Jun 2001
    Posts
    41
    Actually, if we stored the show number instead of the title in tvg::listings, it would make life simpler. Then it would be easier to get details of each show at the end.

  13. #13
    Join Date
    Jun 2001
    Posts
    70
    I didn't need to store it because of the fact that the script already loads them in sequential order into the @tvg::listings . However that might be a very good idea. I like your method of computing the start time of the show. Keep in mind the scripts Jpag produces use times in terms of seconds.

  14. #14
    Join Date
    Jun 2001
    Posts
    70
    Looks like TVGuide has screwed with the page layout again.

    Hey by the way it appears that the beta 1.8.6 version of the script might have fixed the short titles. Maybe.
    Last edited by stryder; 07-02-2001 at 07:46 PM.

  15. #15
    Join Date
    Jun 2001
    Posts
    41
    His 1.8.6b code works fine except for one bug I can find so far.

    It appears to drop the first channel number in the list. To fix, do the following:

    Near the bottom of "sub parse_listings"

    Change:

    s/>//g;
    s/\s+$//;

    next if length($_) < 2;


    To read:


    s/>//g;
    s/\s+$//;
    s/\:clist//g; # Add this line.

    next if length($_) < 2;


    This fixes the bug.

    Hopefully they will stick with this code this time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •