Out of pure ignorance I decided to try out the task of writing a new WebEPG grabber for ontv.dk since the old one is defunct and ontv.dk seems to be one of the most comprehensive TV-guides in DK.
So far I got the basics going mostly thanks to the guides on the site and snooping in working grabber files. However I need some help to make this work as well as intended.
This is what my xml file looks like so far (the file is attatched!):
Getting WebEPG to grab TITLE and START time from the main page was easy pie, but moving on from there turned out to be more confusing.
Each program listed on the main page links to a sub-page with descriptions and other stuff - the contents depends on the type of program (this is a problem in itself that I will get back to later). As I tried to add more stuff my grabber somehow lost the ability to grab stuff from the sub-page. This is the problem I am working on right now, but if anybody sees the glaring error in the xml file please feel free to give me a tip
Due to the diversity of content on the sub-pages I am confused whether it makes more sense to use several templates to look for different info under different circumstances or whether it is possible to do much the same by use of the Searches/Search stuff that can be added after Sublinks. Either way I have not been able to figure out if it is even possible to have several (as in >2) templates grabbing info from the web pages. Anybody with any experience in this field please tip me off, send me a file with an obscure example .. anything please!
While trying to figure out how grabber files work I've been using WebEPG Designer, which helps a lot, but some concepts elude me. The start and end conditions of the templates are confusing me since WebEPG Designer accepts HTML tags whereas the final xml file reports an error in my browser if I copy them directly. Transforming them into the same gibberish used in TemplateText makes the xml file acceptable, but leaves me with no way of testing whether the start and end conditions are actually working...
I will probably uncover many more problems as I move along, but these are the most annoying issues for now. Hope somebody can lend a hand testing or point me to solutions for some of my problems
So far I got the basics going mostly thanks to the guides on the site and snooping in working grabber files. However I need some help to make this work as well as intended.
This is what my xml file looks like so far (the file is attatched!):
Code:
<?xml version="1.0" encoding="utf-8"?>
<Grabber>
<Info language="da" availableDays="14" timezone="W. Europe Standard Time" version="0.0.3" />
<Channels>
<Channel id="dr2@dr.dk" siteId="2" />
</Channels>
<Listing type="Html">
<Site url="http://ontv.dk/tv/[ID]/[YYYY]-[MM]-[DD]" post="" external="false" encoding="" />
<Html>
<Template name="default" start="<div class="content" id="content">" end="<tr class="bottom">">
<SectionTemplate tags="TPA">
<TemplateText>
<td><p><#START></p></td>
<td><p><a><#TITLE></a></p></td>
</TemplateText>
</SectionTemplate>
</Template>
<Template name="end" start="<div class="content" id="content">" end="<tr class="function">">
<SectionTemplate tags="THP">
<TemplateText>
<td><h1></h1><p> - <#END> på <br/></p>
</TemplateText>
</SectionTemplate>
</Template>
<Template name="subtitle+description+genre" start="<div class="content" id="content">" end="<tr class="function">">
<SectionTemplate tags="HP">
<TemplateText>
<h2></h2><h3></h3><p><br/><br/>(<#SUBTITLE>)<br/><br/><#DESCRIPTION></p><p><br/><br/>Type:</strong> <#GENRE></p>
</TemplateText>
</SectionTemplate>
</Template>
<Sublinks>
<Sublink search="programinfo" template="end">
<Link url="http://ontv.dk/[1]" post="" external="false" encoding="" />
</Sublink>
<Sublink search="programinfo" template="subtitle+description+genre">
<Link url="http://ontv.dk/[1]" post="" external="false" encoding="" />
</Sublink>
</Sublinks>
</Html>
</Listing>
</Grabber>
Getting WebEPG to grab TITLE and START time from the main page was easy pie, but moving on from there turned out to be more confusing.
Each program listed on the main page links to a sub-page with descriptions and other stuff - the contents depends on the type of program (this is a problem in itself that I will get back to later). As I tried to add more stuff my grabber somehow lost the ability to grab stuff from the sub-page. This is the problem I am working on right now, but if anybody sees the glaring error in the xml file please feel free to give me a tip
Due to the diversity of content on the sub-pages I am confused whether it makes more sense to use several templates to look for different info under different circumstances or whether it is possible to do much the same by use of the Searches/Search stuff that can be added after Sublinks. Either way I have not been able to figure out if it is even possible to have several (as in >2) templates grabbing info from the web pages. Anybody with any experience in this field please tip me off, send me a file with an obscure example .. anything please!
While trying to figure out how grabber files work I've been using WebEPG Designer, which helps a lot, but some concepts elude me. The start and end conditions of the templates are confusing me since WebEPG Designer accepts HTML tags whereas the final xml file reports an error in my browser if I copy them directly. Transforming them into the same gibberish used in TemplateText makes the xml file acceptable, but leaves me with no way of testing whether the start and end conditions are actually working...
I will probably uncover many more problems as I move along, but these are the most annoying issues for now. Hope somebody can lend a hand testing or point me to solutions for some of my problems