Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updating

  • Loading branch information...
commit adf8c526de2cfeb78d8a27cf223abc2fd5ec3500 1 parent 558c03c
@iker iker authored
Showing with 43 additions and 1 deletion.
  1. +42 −0 trygger/RSS-izator.xml
  2. +1 −1  trygger/YQLfeeder.xml
View
42 trygger/RSS-izator.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
+ <meta>
+ <sampleQuery>select * from {table} where yqlQuery="select * from arxiv.search where search_query='all:electron'";</sampleQuery>
+ <author>Iker Azpeitia</author>
+ <documentationURL>http://www.onekin.org/</documentationURL>
+ <description>This table calls yqlQuery and envelops the result in RSS 2.0 channel </description>
+ </meta>
+ <bindings>
+ <select itemPath="" produces="XML">
+ <urls>
+ <url/>
+ </urls>
+ <inputs>
+ <key id="yqlQuery" type="xs:string" paramType="variable" required="true"/>
+ </inputs>
+ <execute><![CDATA[
+ var yqlQuery = unescape(yqlQuery);
+ var results= y.query(yqlQuery).results;
+ var res = new XML (results);
+ var currentTime = new Date();
+ var feedroot = <rss version="2.0">
+ <channel>
+ <title>From ODT to RSS feed </title>
+ <pubDate>{currentTime}</pubDate>
+ </channel>
+ </rss>;
+
+ var list = res.children();
+ for each (var entry in list){
+
+ feeditem = <item>
+ {entry}
+ </item>;
+ feedroot.rss += feeditem;
+ }
+ response.object = feedroot;
+ ]]></execute>
+ </select>
+
+ </bindings>
+</table>
View
2  trygger/YQLfeeder.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
- <sampleQuery>select * from {table} where yqlQuery="select * from 'arxiv.search' where search_query='all:electron'";</sampleQuery>
+ <sampleQuery>select * from {table} where yqlQuery="select * from arxiv.search where search_query='all:electron'";</sampleQuery>
<author>Iker Azpeitia</author>
<documentationURL>http://www.onekin.org/</documentationURL>
<description>This table calls yqlQuery and envelops the result in RSS 2.0 channel </description>
Please sign in to comment.
Something went wrong with that request. Please try again.