-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrss_channel_data.xml
35 lines (31 loc) · 1.28 KB
/
rss_channel_data.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?xml version="1.0" encoding="UTF-8" ?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>Paul Daniel (hapdaniel)</author>
<description> Takes a given RSS feed and copies the feed's title and link
to each item in the feed. Could be used to add the feed title
to the title of each feed item.
</description>
<sampleQuery>select * from {table} where url="www.myfeed.rss"</sampleQuery>
</meta>
<bindings>
<select itemPath="results.rss.channel.item" produces="XML">
<urls>
<url></url>
</urls>
<inputs>
<key id="url" type="xs:string" paramType="variable" required="true" />
</inputs>
<execute><![CDATA[
var search = y.query("select * from xml where url=@url",{url:url}).results;
var header1 = search.rss.channel.title.toString();
var header2 = search.rss.channel.link.toString();
for each (var item in search.rss.channel.item) {
item.header.title += <title>{header1}</title>;
item.header.link += <link>{header2}</link>;
}
response.object = search;
]]></execute>
</select>
</bindings>
</table>