0

Can I use YQL REST QUERY inside a data table

I'm trying to use the below YQL REST QUERY inside a data table, but it's not returning any results.

select * from html where url="http://ca.music.yahoo.com/" and xpath="//[@class='txt']//[@class='accd']/span[1]"

I would appreciate any help.

by
4 Replies
  • Can you post your full YQL execute block here?

    Are you using y.rest?

    Thanks -Paul YQL Team

    0
  • Hi Paul,

    Thanks for replying. I'm a newbie to YQL. I tried this referring to the examples in the YQL documentation. I'm not sure where I'm going wrong. Please help me.

    <?xml version="1.0" encoding="UTF-8"?>
    <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
        <meta>
            <author>Karthik Vasudevan</author>
            <documentationURL>http://www.kaartz.in/htmle/docu/index.php</documentationURL>
            <sampleQuery>select * from {table} where url="http://ca.music.yahoo.com/" and xpath="where url="//*[@class='txt']//*[@class='accd']/span[1]"</sampleQuery>
        </meta>
        <bindings>
            <select itemPath="query.results" produces="XML">
                <urls>
                    <url></url>
                </urls>
                <inputs>
                    <key id="urle" type="xs:string" paramType="variable" />
                    <key id="xpath1" type="xs:string" paramType="variable" />
                </inputs>
                        <execute><![CDATA[
                              var query = null;
                              query = y.query("http://query.yahooapis.com/v1/public/yql?q=select * from html where url=@urle and xpath=\"" xpath1 "\"", {urle:urle, xpath1:xpath1});
                              response.object = query.results;
                              ]]></execute>
            </select>
        </bindings>
    </table>
    
    0
  • this wrong

    y.query("http://query.yahooapis.com/v1/public/yql?q=select * from html where url=@urle and xpath=\"" xpath1 "\"", {urle:urle, xpath1:xpath1})
    
    
    

    do something like this


    var output=y.query("show tables", param); response.object = output.results;
    0
  • Thanks Markandey.

    I would really appreciate, if you could explain how to do it correctly. I'm pretty new to YQL.

    0

Recent Posts

in YQL