【问题标题】:How do I combine multiple rest queries using YQL?如何使用 YQL 组合多个其余查询?
【发布时间】:2011-06-22 11:24:02
【问题描述】:
例如,我想将多个查询其余查询组合在一起。现在,我一次使用不同的 URL 执行以下代码。我认为在我的情况下最终提出 10 个链接的请求会更快。任何帮助表示赞赏。
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;'
【问题讨论】:
标签:
yahoo
yql
yahoo-pipes
【解决方案1】:
一种可能性是为此构建您自己的 YQL 表,然后在 <execute>...</execute> 块中执行您需要的 javascript。
想到的另一个选择是query.multi YQL 表。
不确定它是否符合您的要求,但您可以尝试一下。不要更改尾随引号 ("),它需要直接保留在最后一个分号之后(这是我刚刚挣扎了几分钟的错误)。
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';"