Permalink
Browse files

Yahoo voice tables, featured articles allows you to put the main page…

… of a yvoice contributor and it will extract their featured articles

recent articles, takes the same input as featured articles but returns the their articles most recent to latest

The recent comments table, takes a specific article page and returns the comments on that article, with the most recent first and latest last.
  • Loading branch information...
1 parent c5af214 commit a95ca2bf9df01772c013a7d64ea8456a9841f6cd @houyhnhnm committed Feb 7, 2012
Showing with 144 additions and 0 deletions.
  1. +51 −0 yvoice/yvoice.featuredarticles.xml
  2. +53 −0 yvoice/yvoice.recentarticles.xml
  3. +40 −0 yvoice/yvoice.recentcomments.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd" securityLevel="any">
+ <meta>
+ <author>HOUYHNHNM</author>
+ <description> Gets the list of featured articles by a Yahoo Voice contributor from their frontpage</description>
+ <documentationURL></documentationURL>
+ <sampleQuery>select * from {table} where query="http://contributor.yahoo.com/user/270293/carol_rucker.html"</sampleQuery>
+ <sampleQuery>select * from {table} where query="http://contributor.yahoo.com/user/1167189/r_salley.html"</sampleQuery>
+ </meta>
+ <bindings>
+ <select itemPath="" produces="XML">
+ <inputs>
+ <key id='query' type='xs:string' paramType='variable' required="true"/>
+ </inputs>
+ <execute>
+ <![CDATA[
+ var str1="select * from html where url=\"";
+ var str2="\" and xpath='//div[@class=\"sliding_feature\"]/div[@class=\"sliding_mask\"]/div[@class=\"sliding_content\"]/div[@class=\"item\"]'";
+ var yqlquery=y.query(str1+query+str2);
+ var yqlresults=yqlquery.results;
+ var yqlcounter=parseInt(yqlresults.div.length());
+ var index=0;
+ var xmlret=new XML();
+ xmlret=<root><count>{yqlcounter}</count></root>;
+ while(index<yqlcounter)
+ {
+ if(yqlresults.div[index].span.length()>0)
+ {
+ xmlret.root+=<node>
+ <title>{yqlresults.div[index].span[0].text()}</title>
+ <description>{yqlresults.div[index].span[1].text()}</description>
+ <link>{yqlresults.div[index].a.@href}</link>
+ <thumbnail>{yqlresults.div[index].div.img.@src}</thumbnail>
+ </node>
+ }
+ else
+ {
+ xmlret.root+=<node>
+ <title>{yqlresults.div[index].a.span[0].text()}</title>
+ <description>{yqlresults.div[index].a.span[1].text()}</description>
+ <link>{yqlresults.div[index].a.@href}</link>
+ </node>
+ }
+ index++;
+ }
+ response.object=xmlret;
+ ]]>
+ </execute>
+ </select>
+ </bindings>
+</table>
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd" securityLevel="any">
+ <meta>
+ <author>HOUYHNHNM</author>
+ <description> Gets the list of articles started with most recent</description>
+ <documentationURL></documentationURL>
+ <sampleQuery>select * from {table} where query="http://contributor.yahoo.com/user/270293/carol_rucker.html"</sampleQuery>
+ <sampleQuery>select * from {table} where query="http://contributor.yahoo.com/user/1167189/r_salley.html"</sampleQuery>
+ </meta>
+ <bindings>
+ <select itemPath="" produces="XML">
+ <inputs>
+ <key id='query' type='xs:string' paramType='variable' required="true"/>
+ </inputs>
+ <execute>
+ <![CDATA[
+ var str1="select * from html where url=\"";
+ var str2="\" and xpath='//ul[@class=\"results_list\"]/li[@class=\"clearfix\"]'";
+ var yqlquery=y.query(str1+query+str2);
+ var yqlresults=yqlquery.results;
+ var yqlcounter=parseInt(yqlresults.li.length());
+ var index=0;
+ var xmlret=new XML();
+ xmlret=<root><count>{yqlcounter}</count></root>;
+ while(index<yqlcounter)
+ {
+ if(parseInt(yqlresults.li[index].div.length())>1)
+ {
+ xmlret.root+=<node>
+ <title>{yqlresults.li[index].div[1].a.text()}</title>
+ <description>{yqlresults.li[index].div[1].div[1]}</description>
+ <link>{yqlresults.li[index].div[1].a.@href}</link>
+ <pubdate>{yqlresults.li[index].div[1].div[0].p.text()}</pubdate>
+ <thumbnail>{yqlresults.li[index].div[0].img.@src}</thumbnail>
+ </node>
+ }
+ else
+ {
+ xmlret.root+=<node>
+ <title>{yqlresults.li[index].div.a.text()}</title>
+ <description>{yqlresults.li[index].div.div[1].p.text()}</description>
+ <link>{yqlresults.li[index].div.a.@href}</link>
+ <pubdate>{yqlresults.li[index].div.div[0].p.text()}</pubdate>
+ </node>
+ }
+ index++;
+ }
+ response.object=xmlret;
+ ]]>
+ </execute>
+ </select>
+ </bindings>
+</table>
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd" securityLevel="any">
+ <meta>
+ <author>HOUYHNHNM</author>
+ <description> Gets the most recent comments from an article</description>
+ <documentationURL></documentationURL>
+ <sampleQuery>select * from {table} where query="http://voices.yahoo.com/create-wire-details-enhance-favorite-craft-10919947.html?cat=24"</sampleQuery>
+ <sampleQuery>select * from {table} where query="http://voices.yahoo.com/a-day-out-taste-south-france-chteau-planeres-10865399.html?cat=16"</sampleQuery>
+ </meta>
+ <bindings>
+ <select itemPath="" produces="XML">
+ <inputs>
+ <key id='query' type='xs:string' paramType='variable' required="true"/>
+ </inputs>
+ <execute>
+ <![CDATA[
+ var str1="select * from html where url=\"";
+ var str2="\" and xpath='//div[@class=\"comment_list\"]/ul/li[@class=\"clearfix\"]'";
+ var yqlquery=y.query(str1+query+str2);
+ var yqlresults=yqlquery.results;
+ var yqlcounter=parseInt(yqlresults.li.length());
+ var index=0;
+ var xmlret=new XML();
+ xmlret=<root><count>{yqlcounter}</count></root>;
+ while(index<yqlcounter)
+ {
+ xmlret.root+=<node>
+ <title>{yqlresults.li[index].cite.span.text()}</title>
+ <description>{yqlresults.li[index].p.text()}</description>
+ <link>{query}</link>
+ <pubdate>{yqlresults.li[index].cite.text()}</pubdate>
+ </node>
+ index++;
+ }
+ response.object=xmlret;
+ ]]>
+ </execute>
+ </select>
+ </bindings>
+</table>

0 comments on commit a95ca2b

Please sign in to comment.