0

Open Data Table <urls> element?

If I have the following in my Open Data Table specification:

CODE
  <bindings>
<select itemPath="" produces="XML">
<urls>
<url>http://finance.yahoo.com/q?s={ticker}</url>
<url>http://finance.yahoo.com/q/pr?s={ticker}</url>
<url>http://finance.yahoo.com/q/hp?s={ticker}</url>
</urls>
<inputs>
<key id='ticker' type='xs:string' paramType='path' required='true' />
</inputs>
<execute><![CDATA[
response.object =
<stock symbol={ticker}>
<test>{request.url}</test>
</stock>
]]></execute>
</select>
</bindings>

When I test this I only get the last <url> element:

CODE
    <results>
<stock symbol="yhoo">
<test>http://finance.yahoo.com/q/hp?s=yhoo</test>
</stock>
</results>

How do I refer to the other <url>s in <urls>?

Also the OAuth Signed Request to Netflix example has:

CODE
    <urls>  
<url env="all">http://api.netflix.com/catalog/titles/</url>
</urls>

But I don't see in the Open Data Table Reference any mention of the attributes of the <url> element?

by
6 Replies
  • QUOTE (Marcus @ Jul 31 2009, 05:03 PM) <{POST_SNAPBACK}>
    Here's mention of the url element in the docs. But it doesn't clarify the problem you're having.


    At the moment only one <url> should be used in the url element. To fetch more than one url at once you should use the execute section of the table with some javascript.

    Jonathan
    0
  • Yes, that's what I ended up doing in
    Using YQL to get summary information on a stock from Yahoo Finance via a single HTTP Get.

    The reason I asked was because the Open Data Tables Reference section says:

    QUOTE
    While generally there is only one URL specified, if your service supports a "test" select and you'd like to expose it, you can add an additional url elements for that environment.

    While I've got your attention, any help on the remaining questions in
    Open Data Table's execute Javascript quirks? (The other "quirks" were just the result of lack of sleep):

    1. Why is it that the y.log() statement seems to sometimes spit out the future value of an element?
      This makes debugging tricky since you can't rely on y.log() to give you the proper state of a variable.
      One of my theories is that the y.log() is queued up somehow with a pointer to the variable rather than copying its current value.
    2. Why is it that y.query()s to Yahoo's own Yahoo Finance site to get a stock's Profile page will often result in 500 Internal Server Errors?
      (This seems to have stopped happening once I decided I'd investigate it ;)Jonathan
    0
  • QUOTE (Tom @ Aug 3 2009, 04:53 PM) <{POST_SNAPBACK}>
    Yes, that's what I ended up doing in
    Using YQL to get summary information on a stock from Yahoo Finance via a single HTTP Get.

    The reason I asked was because the Open Data Tables Reference section says:


    While I've got your attention, any help on the remaining questions in
    Open Data Table's execute Javascript quirks? (The other "quirks" were just the result of lack of sleep):

    1. Why is it that the y.log() statement seems to sometimes spit out the future value of an element?
      This makes debugging tricky since you can't rely on y.log() to give you the proper state of a variable.
      One of my theories is that the y.log() is queued up somehow with a pointer to the variable rather than copying its current value.
    2. Why is it that y.query()s to Yahoo's own Yahoo Finance site to get a stock's Profile page will often result in 500 Internal Server Errors?
      (This seems to have stopped happening once I decided I'd investigate it ;)Jonathan
    0
  • QUOTE (Jonathan @ Aug 25 2009, 03:52 PM) <{POST_SNAPBACK}>
    (1) We'll take a look. Are there specific things that you are logging that show this behavior?


    The middle of my Open Data Table's execute Javascript quirks? post shows a detailed example of this happening.
    0
  • BTW, I found an answer to my own question:

    QUOTE
    O, and why is it that when I preview messages to this forum they look fine but when I look at the actual post, long paragraphs show up as one loooong line?
    The only way to read them is to copy them and paste into an editor.

    See Greasemonkey script to solve unreadably long paragraphs problem in YDN Forum posts for the answer :r
    0
  • Tom,

    This should be fixed now. Thanks for pointing it out.

    Robyn Tippins
    Community Manager, YDN
    0
  • Recent Posts

    in YQL