home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Support
Electronic Program Guide
WebEPG
Grabbing listings from a locally hosted php script
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Alphathon" data-source="post: 924106" data-attributes="member: 105814"><p>I imagine this scenario isn't all that common so I understand if no-one has an answer to this. Regardless, here goes.</p><p> </p><p>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:</p><p> </p><p><strong>Basic format:</strong></p><p>[HTML]<table border="1"></p><p><tr><th>#TITLE</th></tr></p><p><tr><td>#SUBTITLE</td></tr></p><p><tr><td>#EPISODE</td></tr></p><p><tr><td>#START</td></tr></p><p><tr><td>#DESCRIPTION</td></tr></p><p><tr><td>#GENRE</td></tr></p><p></table>[/HTML]</p><p><strong>Example:</strong></p><p>[HTML]<table border="1"></p><p><tr><th>Zwei Männer am Herd</th></tr></p><p><tr><td>Wie Pfeffer und Salz</td></tr></p><p><tr><td></td></tr></p><p><tr><td>06:15</td></tr></p><p><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.</p><p> </p><p>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.</p><p> </p><p>Land: Deutschland</p><p>Jahr: 2000</p><p>Bildformat: 16:9</td></tr></p><p><tr><td>Serie</td></tr></p><p></table>[/HTML]</p><p> </p><p>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:</p><p> </p><p>[CODE]&lt;table border="1"&gt;</p><p>&lt;tr&gt;&lt;th&gt;&lt;#TITLE&gt;&lt;/th&gt;&lt;/tr&gt;</p><p>&lt;tr&gt;&lt;td&gt;&lt;#SUBTITLE&gt;&lt;/td&gt;&lt;/tr&gt;</p><p>&lt;tr&gt;&lt;td&gt;&lt;#EPISODE&gt;&lt;/td&gt;&lt;/tr&gt;</p><p>&lt;tr&gt;&lt;td&gt;&lt;#START&gt;&lt;/td&gt;&lt;/tr&gt;</p><p>&lt;tr&gt;&lt;td&gt;&lt;#DESCRIPTION&gt;&lt;/td&gt;&lt;/tr&gt;</p><p>&lt;tr&gt;&lt;td&gt;&lt;#GENRE&gt;&lt;/td&gt;&lt;/tr&gt;</p><p>&lt;/table&gt;[/CODE]</p><p> </p><p>The address used to test it in this case was <em>-ttp://localhost/public_HTML/ZDFlistings.php?id=ZDF.kultur&y=2012&m=10&d=16</em> 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.</p><p> </p><p>So, then I make up a grabber file, which is shown below:</p><p> </p><p>[HTML]<?xml version="1.0" encoding="utf-8"?></p><p><Grabber></p><p> <Info language="de" availableDays="14" timezone="W. Europe Standard Time" version="2.0" /></p><p> <Channels></p><p> <Channel id="ZDF" siteId="ZDF"/></p><p> <Channel id="ZDF_neo" siteId="ZDFneo"/></p><p> <Channel id="ZDFinfo" siteId="ZDFinfo"/></p><p> <Channel id="ZDF.kultur" siteId="ZDF.kultur"/></p><p> <Channel id="3sat" siteId="3sat"/></p><p> <Channel id="Phoenix" siteId="phoenix"/></p><p> <Channel id="arte" siteId="arte"/></p><p> <Channel id="KiKA" siteId="KI.KA"/></p><p> </Channels></p><p> <Listing type="Html"></p><p> <Site url="http://localhost/public_HTML/ZDFlistings.php?id=[ID]&amp;y=[YYYY]&amp;m=[MM]&amp;d=[DD]" external="false" encoding="utf-8"/></p><p> <Html></p><p> <Template name="default"></p><p> <SectionTemplate tags="T"></p><p> <TemplateText></p><p> &lt;table border="1"&gt;</p><p> &lt;tr&gt;&lt;th&gt;&lt;#TITLE&gt;&lt;/th&gt;&lt;/tr&gt;</p><p> &lt;tr&gt;&lt;td&gt;&lt;#SUBTITLE&gt;&lt;/td&gt;&lt;/tr&gt;</p><p> &lt;tr&gt;&lt;td&gt;&lt;#EPISODE&gt;&lt;/td&gt;&lt;/tr&gt;</p><p> &lt;tr&gt;&lt;td&gt;&lt;#START&gt;&lt;/td&gt;&lt;/tr&gt;</p><p> &lt;tr&gt;&lt;td&gt;&lt;#DESCRIPTION&gt;&lt;/td&gt;&lt;/tr&gt;</p><p> &lt;tr&gt;&lt;td&gt;&lt;#GENRE&gt;&lt;/td&gt;&lt;/tr&gt;</p><p> &lt;/table&gt;</p><p> </TemplateText></p><p> </SectionTemplate></p><p> </Template></p><p> </Html></p><p> </Listing></p><p></Grabber>[/HTML]</p><p> </p><p>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):</p><p> </p><p>[CODE]2012-10-16 17:13:00.981506 [WebEPGImporter(9)]: WebEPG: Getting Channel ID: ZDFinfo</p><p>2012-10-16 17:13:00.985507 [WebEPGImporter(9)]: [10 of 46]</p><p>2012-10-16 17:13:00.988507 [WebEPGImporter(9)]: WebEPG: ChannelId: ZDFinfo</p><p>2012-10-16 17:13:00.991507 [WebEPGImporter(9)]: WebEPG: Grab Start 17:13 16/10/2012</p><p>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</p><p>2012-10-16 17:13:56.703694 [WebEPGImporter(9)]: HTMLPage: GetInternal encoding: Forced: utf-8</p><p>2012-10-16 17:13:56.707694 [WebEPGImporter(9)]: WebEPG: No Listings Found</p><p>2012-10-16 17:13:56.730695 [WebEPGImporter(9)]: WebEPG: Writing Channel: ZDFinfo[/CODE]</p><p> </p><p>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)?</p></blockquote><p></p>
[QUOTE="Alphathon, post: 924106, member: 105814"] 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: [B]Basic format:[/B] [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] [B]Example:[/B] [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>[/HTML] 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>[/CODE] The address used to test it in this case was [I]-ttp://localhost/public_HTML/ZDFlistings.php?id=ZDF.kultur&y=2012&m=10&d=16[/I] 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>[/HTML] 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[/CODE] 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)? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Support
Electronic Program Guide
WebEPG
Grabbing listings from a locally hosted php script
Contact us
RSS
Top
Bottom