0

YQL returns 3 results for a single field

Hello,
I don't think this is a bug from YQL, as the problem comes from Yahoo Finance, but still, just for you to know.

I have this query on Yahoo Finance to retrieve the float shares from instrument AAPL (Apple):
select * from csv where url="http://finance.yahoo.com/d/quotes.csv?s=AAPL&f=f6"

If you type it in the YQL console, then you get three results:
<?xml version="1.0" encoding="UTF-8"?>
<query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"
yahoo:count="0" yahoo:created="2010-10-11T22:36:00Z" yahoo:lang="en-US">
<diagnostics>
<publiclyCallable>true</publiclyCallable>
<redirect from="http://finance.yahoo.com/d/quotes.csv?s=AAPL&amp;amp;f=f6"><![CDATA[http://download.finance.yahoo.com/d/quotes.csv?s=AAPL&amp;f=f6]]></redirect>
<url execution-time="14" proxy="DEFAULT"><![CDATA[http://finance.yahoo.com/d/quotes.csv?s=AAPL&amp;f=f6]]></url>
<user-time>15</user-time>
<service-time>14</service-time>
<build-version>9128</build-version>
</diagnostics>
<results/>
</query>

This because the float shares are received with no quotes around the values.

Is it possible to wrap such values around quotes?

by
1 Reply
  • [quote name='RUI LOPES' date='Oct 11 2010, 02:39 PM' post='19557']
    Oops,
    sorry, the resulting XML is as follow:
    CODEBOX
    <?xml version="1.0" encoding="UTF-8"?>
    <query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"
    yahoo:count="1" yahoo:created="2010-10-11T22:40:12Z" yahoo:lang="en-US">
    <diagnostics>
    <publiclyCallable>true</publiclyCallable>
    <redirect from="http://finance.yahoo.com/d/quotes.csv?s=AAPL&amp;f=f6"><![CDATA[http://download.finance.yahoo.com/d/quotes.csv?s=AAPL&f=f6]]></redirect>
    <url execution-time="8" proxy="DEFAULT"><![CDATA[http://finance.yahoo.com/d/quotes.csv?s=AAPL&f=f6]]></url>
    <user-time>10</user-time>
    <service-time>8</service-time>
    <build-version>9128</build-version>
    </diagnostics>
    <results>
    <row>
    <col0>906</col0>
    <col1>948</col1>
    <col2>000</col2>
    </row>
    </results>
    </query>
    0

Recent Posts

in YQL