- July 15, 2010
- 64
- 8
- Home Country
- Scotland
I imagine this scenario isn't all that common so I understand if no-one has an answer to this. Regardless, here goes.
As good as WebEPG is, it is a tad limited, and doesn't seem to handle multiple variations within a listings page very well. As such, I thought I'd try to pre-process listings using a php script. This also has the advantage that I can reformat parts of the listing to my preference, combine parts from multiple parts of the listing into one field (e.g. combining information on cast, video format etc into the description field where available. So far I have successfully created one such script, as much as a test/experiments as anything else, which takes information from zdf.de and formats it in nice clean HTML tables as shown below:
Basic format:
Example:
So far so good, the php script works; now for the grabber. I have tried out the script in WebEPG designer and it finds all the listings using the following text along with the "T" tag:
The address used to test it in this case was -ttp://localhost/public_HTML/ZDFlistings.php?id=ZDF.kultur&y=2012&m=10&d=16 where ZDF.kultur is the channel and the date is 2012-10-16 (and -ttp = http so as to avoid making it a link). Again, so far so good.
So, then I make up a grabber file, which is shown below:
Unfortunately, when WebEPG tries to grab the data, it finds no listings, with the following recorded in tv.log (in this case when grabbing info for ZDFinfo for 2012-10-16):
Have I made some stupid error with the grabber, or does this have something to do with it being hosted on localhost? Could it even be some kind of timeout issue (each page can take quite a while to load)?
As good as WebEPG is, it is a tad limited, and doesn't seem to handle multiple variations within a listings page very well. As such, I thought I'd try to pre-process listings using a php script. This also has the advantage that I can reformat parts of the listing to my preference, combine parts from multiple parts of the listing into one field (e.g. combining information on cast, video format etc into the description field where available. So far I have successfully created one such script, as much as a test/experiments as anything else, which takes information from zdf.de and formats it in nice clean HTML tables as shown below:
Basic format:
HTML:
<table border="1">
<tr><th>#TITLE</th></tr>
<tr><td>#SUBTITLE</td></tr>
<tr><td>#EPISODE</td></tr>
<tr><td>#START</td></tr>
<tr><td>#DESCRIPTION</td></tr>
<tr><td>#GENRE</td></tr>
</table>
HTML:
<table border="1">
<tr><th>Zwei Männer am Herd</th></tr>
<tr><td>Wie Pfeffer und Salz</td></tr>
<tr><td></td></tr>
<tr><td>06:15</td></tr>
<tr><td>Die Liebeswelt hat ihn endlich wieder. Walter hat sich entschlossen, Giulietta zu erobern, bewaffnet mit einem Italienischsprachkurs, einem Riesenblumenstrauß und einer nächtlich romantischen Einladung zum Hamburger Dom. Von seiner guten Laune profitiert auch Hilmar, der Walter um Wiederaufnahme ins Conrad's bittet und von ihm zu Moritz' Verwunderung prompt eine Zusage erhält.
Nicht weniger erstaunt ist Moritz, als in der folgenden Nacht Walter bei ihm mit wenigen Habseligkeiten vor der Wohnung steht. Sein Hausboot ist aus unerklärlichen Gründen auf Grund gelaufen. Ob Conrads Rachefeldzug dahintersteckt? Auf jeden Fall ist ihm die miese Kritik im örtlichen Restaurantführer zuzuschreiben.
Land: Deutschland
Jahr: 2000
Bildformat: 16:9</td></tr>
<tr><td>Serie</td></tr>
</table>
So far so good, the php script works; now for the grabber. I have tried out the script in WebEPG designer and it finds all the listings using the following text along with the "T" tag:
Code:
<table border="1">
<tr><th><#TITLE></th></tr>
<tr><td><#SUBTITLE></td></tr>
<tr><td><#EPISODE></td></tr>
<tr><td><#START></td></tr>
<tr><td><#DESCRIPTION></td></tr>
<tr><td><#GENRE></td></tr>
</table>
The address used to test it in this case was -ttp://localhost/public_HTML/ZDFlistings.php?id=ZDF.kultur&y=2012&m=10&d=16 where ZDF.kultur is the channel and the date is 2012-10-16 (and -ttp = http so as to avoid making it a link). Again, so far so good.
So, then I make up a grabber file, which is shown below:
HTML:
<?xml version="1.0" encoding="utf-8"?>
<Grabber>
<Info language="de" availableDays="14" timezone="W. Europe Standard Time" version="2.0" />
<Channels>
<Channel id="ZDF" siteId="ZDF"/>
<Channel id="ZDF_neo" siteId="ZDFneo"/>
<Channel id="ZDFinfo" siteId="ZDFinfo"/>
<Channel id="ZDF.kultur" siteId="ZDF.kultur"/>
<Channel id="3sat" siteId="3sat"/>
<Channel id="Phoenix" siteId="phoenix"/>
<Channel id="arte" siteId="arte"/>
<Channel id="KiKA" siteId="KI.KA"/>
</Channels>
<Listing type="Html">
<Site url="http://localhost/public_HTML/ZDFlistings.php?id=[ID]&y=[YYYY]&m=[MM]&d=[DD]" external="false" encoding="utf-8"/>
<Html>
<Template name="default">
<SectionTemplate tags="T">
<TemplateText>
<table border="1">
<tr><th><#TITLE></th></tr>
<tr><td><#SUBTITLE></td></tr>
<tr><td><#EPISODE></td></tr>
<tr><td><#START></td></tr>
<tr><td><#DESCRIPTION></td></tr>
<tr><td><#GENRE></td></tr>
</table>
</TemplateText>
</SectionTemplate>
</Template>
</Html>
</Listing>
</Grabber>
Unfortunately, when WebEPG tries to grab the data, it finds no listings, with the following recorded in tv.log (in this case when grabbing info for ZDFinfo for 2012-10-16):
Code:
2012-10-16 17:13:00.981506 [WebEPGImporter(9)]: WebEPG: Getting Channel ID: ZDFinfo
2012-10-16 17:13:00.985507 [WebEPGImporter(9)]: [10 of 46]
2012-10-16 17:13:00.988507 [WebEPGImporter(9)]: WebEPG: ChannelId: ZDFinfo
2012-10-16 17:13:00.991507 [WebEPGImporter(9)]: WebEPG: Grab Start 17:13 16/10/2012
2012-10-16 17:13:01.114514 [WebEPGImporter(9)]: WebEPG: Reading http://localhost/public_HTML/ZDFlistings.php?id=ZDFinfo&y=2012&m=10&d=16 POST: - Delay: 500ms
2012-10-16 17:13:56.703694 [WebEPGImporter(9)]: HTMLPage: GetInternal encoding: Forced: utf-8
2012-10-16 17:13:56.707694 [WebEPGImporter(9)]: WebEPG: No Listings Found
2012-10-16 17:13:56.730695 [WebEPGImporter(9)]: WebEPG: Writing Channel: ZDFinfo
Have I made some stupid error with the grabber, or does this have something to do with it being hosted on localhost? Could it even be some kind of timeout issue (each page can take quite a while to load)?
Last edited: