How do I combine multiple rest queries using YQL?

后端 未结 1 696
心在旅途
心在旅途 2021-01-06 20:30

For example I would like to combine multiple queries rest queries together. Right now I do the following code with different URLs one at a time. I think it would be faster

1条回答
  •  难免孤独
    2021-01-06 21:12

    One possibility would be to build your own YQL table for this, which then executes the javascript you need in an ... block.

    The other alternative that comes to mind is the query.multi YQL table.

    Not sure that does what you want it do to but you can give it a try. Don't change the trailing quotation mark ("), it needs to stay directly after the last semicolon (this was a mistake that I just struggled with for some minutes).

    USE 'http://javarants.com/yql/javascript.xml' AS j; 
    
    SELECT * FROM query.multi WHERE queries="
    select * from j where code='response.object = y.rest(\\'http://feedproxy.google.com/~r/Techcrunch/~3/P%5FqWQXyAPU/\\').followRedirects(false).get().headers';
    select * from j where code='response.object = y.rest(\\'http://stackoverflow.com/feeds/question/4917144\\').followRedirects(false).get().headers';"
    

    0 讨论(0)
提交回复
热议问题