Z-tag breaking WebEPG (1 Viewer)

vuego

Documentation Group
  • Team MediaPortal
  • August 5, 2006
    1,639
    764
    Göteborg
    Home Country
    Sweden Sweden
    I'm trying to create a grabber for metro.se and need some help with dynamic tags. The template needs to work both with and without a Span tag in the html code.

    Here's what the two different cases looks like:
    Without End time:
    <tr>

    <td class="charttime" valign="top" width="40">05:15</td>
    <td><img src="/shared/1x1blank.gif" width="6" height="1"></td>
    <td valign="top" width="430" colspan="3">
    <span class="charteventname">
    Lättlagat
    <br><span class="chartdescription">
    Svenskt matprogram från 2003. Läcker och lättlagad vardagsmat är mottot för programmet. Kockarna Pelle Johansson, Kråke Lithander, Sacha Smederevac och bagaren Johan Sörberg alternerar bland grytorna och tillsammans med gäster bjuder de på enkla recept och ger handfasta tips som förenklar och underlättar i köket. 30/8. Producerat år 2003.
    </span>


    </td>
    <td>
    <img src="/shared/1x1blank.gif" width="4" height="1">
    </td>

    <td>&nbsp;</td>



    </tr>
    With End time:
    <tr>

    <td class="charttime" valign="top" width="40">05:50</td>
    <td><img src="/shared/1x1blank.gif" width="6" height="1"></td>
    <td valign="top" width="430" colspan="3">
    <span class="charteventname">
    Nyhetsmorgon</span> (10:00)
    <br><span class="chartdescription">
    Nyhetsmagasin. Nyheter, ekonominyheter, sport och väder varje halvtimme med start klockan 06.00 samt lokala nyheter. Dessutom aktuella gäster och musikunderhållning samt trisskrap.
    </span>


    </td>
    <td>
    <img src="/shared/1x1blank.gif" width="4" height="1">
    </td>

    <td>&nbsp;</td>



    </tr>
    This looks fairly straight forward. I just need to make the </span> optional using WebEPG's Z tag but I can't get it to work :oops:

    Here's my grabber:
    Code:
    Start: <!-- Tabl
    End: <!-- Flikmeny -->
    Tags: BST
    Template:
    <td><#START></td>
    <td></td>
    <td>
    <span>
    <#TITLE><z(></span> (<#END>)</z)?>
    <br><span>
    <#DESCRIPTION>
    </span>
    </td>

    This works perfectly in WebEPG Designer. All programs are found and with the #END tag where available. But it won't work when running WebEPG.exe.
    webEPG.log:
    2008-10-26 20:23:11.719911 [Info.][WebEPG-xmltv]: WebEPG: Getting Channel ID: tv4@tv4.se
    2008-10-26 20:23:11.719911 [Info.][WebEPG-xmltv]: [1 of 1]
    2008-10-26 20:23:11.723817 [Info.][WebEPG-xmltv]: WebEPG: Opening SE\metro_se.xml
    2008-10-26 20:23:11.993331 [Info.][WebEPG-xmltv]: WebEPG: Version: 2.1.0
    2008-10-26 20:23:11.993331 [Info.][WebEPG-xmltv]: WebEPG: TimeZone, Local: W. Europe Standard Time
    2008-10-26 20:23:11.994308 [Info.][WebEPG-xmltv]: WebEPG: TimeZone, Site : W. Europe Standard Time
    2008-10-26 20:23:12.039227 [Info.][WebEPG-xmltv]: WebEPG: ChannelId: tv4@tv4.se
    2008-10-26 20:23:12.040203 [Debug][WebEPG-xmltv]: WebEPG: Grab Start 20:23 2008-10-26
    2008-10-26 20:23:12.081216 [Info.][WebEPG-xmltv]: WebEPG: Reading DagensTv.com Standardguide POST:
    2008-10-26 20:23:12.639774 [Info.][WebEPG-xmltv]: WebEPG: Listing Count 38
    2008-10-26 20:23:12.659304 [Debug][WebEPG-xmltv]: WebEPG: Program Count (0), Listing Count (38), Discard Count (0)
    2008-10-26 20:23:12.659304 [Warn.][WebEPG-xmltv]: WebEPG: Program Count (0) < Listing Count (38) - Discard Count (0), possible template error
    2008-10-26 20:23:12.662234 [Info.][WebEPG-xmltv]: WebEPG: Reading DagensTv.com Standardguide POST:
    2008-10-26 20:23:13.247157 [Info.][WebEPG-xmltv]: WebEPG: Listing Count 41
    2008-10-26 20:23:13.252040 [Debug][WebEPG-xmltv]: WebEPG: Program Count (0), Listing Count (41), Discard Count (0)

    2008-10-26 20:23:13.253016 [Warn.][WebEPG-xmltv]: WebEPG: Program Count (0) < Listing Count (41) - Discard Count (0), possible template error
    2008-10-26 20:23:13.253993 [Info.][WebEPG-xmltv]: WebEPG: Writing Channel to XMLTV: TV4
    2008-10-26 20:23:13.257899 [Info.][WebEPG-xmltv]: HTTP Statistics: Site metro.dagenstv.com : Pages 2 : Bytes 131946 : Total Time 00:00:01.1132100 : Av. Rate 118,5275 KBps
    2008-10-26 20:23:13.258875 [Info.][WebEPG-xmltv]: WebEPG: Finished

    If I remove <z(></span> (<#END>)</z)?> from the template WebEPG finds all programs (that has no end time) with no errors in webEPG.log.

    All help appreciated
     

    Attachments

    • webepg designer.png
      webepg designer.png
      64.4 KB

    Frantid

    Portal Pro
    October 11, 2008
    117
    12
    Home Country
    Iceland Iceland
    you might try adding in the h1 tags around the title in the template. I have problems getting z tags to work when there aren't a nice set of open and closed element tags around what I'm looking for.

    frantid

    edit - never mind - for some reason it's not detecting the h1 as tags. Try the below. I just can't get the descriptions on the entries with end times. It should not work, but it does in designer. I think the z tags are "greedy" and thus a little hard to follow. I'd copy and paste this. I just did trial and error. I hope it works for you.

    edit2 - tried again - the problem is it can't find the title ... here's another shot....

    <td><#START></td>
    <td></td>
    <td>
    <span class="charteventname">

    <z(></span> </z)?><#TITLE>
    <br><span class="chartdescription">
    <#DESCRIPTION>
    </span>
    </td>
     

    vuego

    Documentation Group
  • Team MediaPortal
  • August 5, 2006
    1,639
    764
    Göteborg
    Home Country
    Sweden Sweden
    • Thread starter
    • Moderator
    • #3
    Thanks for the reply Frantid!

    Shouldn't the <z(></span> </z)?> come after <#TITLE>? This is the way it it in the HTML code.

    Did you forget the <#END> tag? :)

    Could my problem be that the end time is inside parenthesis which is a regex special character? I tried escaping the parenthesis but it didn't help. What really worries me though is the different results in WebEPG Designer and WebEPG itself. It makes the Designer kinda useless... :(
     

    Frantid

    Portal Pro
    October 11, 2008
    117
    12
    Home Country
    Iceland Iceland
    Thanks for the reply Frantid!

    Shouldn't the <z(></span> </z)?> come after <#TITLE>? This is the way it it in the HTML code.

    Did you forget the <#END> tag? :)

    Could my problem be that the end time is inside parenthesis which is a regex special character? I tried escaping the parenthesis but it didn't help. What really worries me though is the different results in WebEPG Designer and WebEPG itself. It makes the Designer kinda useless... :(

    I think you're right it should come after title, but the problem is when you do it that way it can't find the title. You have to look for title in the designer. With your code it does not find the title, so it won't get any of the listings, though it parses the correct number of programs.

    I didn't forget the end tag. The problem is that in searching for the end tag, the title does not get found. Did you give it a try?

    Frantid.
     

    vuego

    Documentation Group
  • Team MediaPortal
  • August 5, 2006
    1,639
    764
    Göteborg
    Home Country
    Sweden Sweden
    • Thread starter
    • Moderator
    • #5
    Forgive me, I'm very confused.

    You have to look for title in the designer.

    What do you mean by this? As you can see in my screen shot the Designer finds all Titles (and Start, End, Description as well). Perhaps I'm not doing it correct.

    I didn't forget the end tag. The problem is that in searching for the end tag, the description does not get found. Did you give it a try?

    Yes I tried it. In the designer it finds no Titles or End times. The grabber finds all programs but uses the End time as Title

    <tr> <td class="charttime" valign="top" width="40"><#START></td>
    <td><img ></td>
    <td >
    <span class="charteventname">
    <z(><#TITLE></span>(<#END>)|<#TITLE></z)?>
    <br><span class="chartdescription">
    <#DESCRIPTION> </span>
    </td>
    <td>
    <img >
    </td>
    <td>&nbsp;</td>
    </tr>
    This one is missing Title in the designer and End time is broken "19:00)". The grabber finds only the programs with end times (Program Count (4), Listing Count (29), Discard Count (0)) and no End or Description.
    :confused:

    BTW if you'd like to try it in the designer you can use this URL:
    http://metro.dagenstv.com/se/chart/?dat=2008-11-01&cha=21
     

    Frantid

    Portal Pro
    October 11, 2008
    117
    12
    Home Country
    Iceland Iceland
    Hi, when I try your template, using that url - I don't get any title fields. Just starts and descriptions - 29 programs listed. Maybe I have an old designer. That 2nd template I posted doesn't work well. The first one I posted (without end) works better for me, but it does not find the title on programs with an end.

    Have you ever thought about using this site?


    Using this template I can get everything.

    start
    <!-- Program -->
    end
    <!-- Slut Content-tabell -->

    tags D

    Template text

    <div class="tbl_lrg_event">

    <a ></a>

    <div class="tbl_lrg_event_time">
    <#START> (<#END>)

    </div>
    <div class="tbl_lrg_event_name">
    <#TITLE> <span class="tbl_lrg_event_name_past">[Repris]</span>
    </div>

    <div class="tbl_lrg_event_description">
    <z(><#DESCRIPTION> [<#EPISODE>]
    <form ><div ><div ></div><div ></div></div></form>
    </div></z)?>
    <z(><#DESCRIPTION> [<#EPISODE>]
    </div></z)?>
    <div class="tbl_lrg_event_icons">

    <a ><img /></a><a ><img /></a>
    <a >
    <img /></a>
    </div>
    <div ">

    </div>
    </div>
     

    Users who are viewing this thread

    Top Bottom