如何使用YQL合并多个其余查询? [英] How do I combine multiple rest queries using YQL?
问题描述
例如,我想将多个查询,其余查询组合在一起.现在,我一次用不同的URL执行以下代码.我认为在我的情况下,最终一次请求10个链接会更快.感谢您的帮助.
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 to ultimately make one request for 10 links in my case. Any help is appreciated.
use 'http://javarants.com/yql/javascript.xml'as j; select * from j where code='response.object = y.rest("http://feedproxy.google.com/~r/Techcrunch/~3/P%5FqWQXyAPU/").followRedirects(false).get().headers.location;'
推荐答案
一种可能性是为此构建自己的YQL表,然后在<execute>...</execute>
块中执行所需的javascript.
One possibility would be to build your own YQL table for this, which then executes the javascript you need in an <execute>...</execute>
block.
想到的另一种选择是query.multi
YQL表.
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';"
这篇关于如何使用YQL合并多个其余查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!