Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 49 lines (44 sloc) 1.431 kb
b20c62f @frichez Cinetelerevue tv programs
frichez authored
1 <?xml version="1.0" encoding="UTF-8"?>
2 <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
3 <meta>
4 <author>fred.ac</author>
5 <description>Cinetelerevue channels</description>
6 <sampleQuery><![CDATA[
7 select * from channels;
8 ]]></sampleQuery>
9 </meta>
10 <bindings>
11 <select itemPath="channels.channel" produces="XML">
12 <urls>
77e834a @frichez Upgrade to new site layout.
frichez authored
13 <url>http://www.cinetelerevue.be/fr/programmes-tele.html</url>
b20c62f @frichez Cinetelerevue tv programs
frichez authored
14 </urls>
15 <inputs>
16 </inputs>
17 <execute><![CDATA[
77e834a @frichez Upgrade to new site layout.
frichez authored
18 /*var data = y.rest(request.url)
b20c62f @frichez Cinetelerevue tv programs
frichez authored
19 .accept('text/html')
77e834a @frichez Upgrade to new site layout.
frichez authored
20 .get().response;*/
21
22 var data = y.query("select * from html where url='" + request.url + "' and charset='iso-8859-1'").results.children();
23
24 if (data == null) {
25 y.log("no response from cinetelerevue");
26 exit(0);
27 }
b20c62f @frichez Cinetelerevue tv programs
frichez authored
28
29 var channels = <channels/>;
30
77e834a @frichez Upgrade to new site layout.
frichez authored
31 var xdata = y.xpath(data, "//select[@id='selCat2']");
32 if (xdata) {
33 for each (var option in xdata.option) {
34 if (option.@value != "") {
35 var channel = <channel/>;
36 channel.node += <id>{option.@value.toString()}</id>;
37 channel.node += <name>{option.toString()}</name>;
38 channel.node += <iconUrl>http://tv.ctr-ns.be/logos_chaines/{option.@value.toString()}.jpg</iconUrl>;
39 channels.node += channel;
40 }
41 }
42 }
b20c62f @frichez Cinetelerevue tv programs
frichez authored
43 response.object = channels;
44 ]]>
45 </execute>
46 </select>
47 </bindings>
48 </table>
Something went wrong with that request. Please try again.