How to combine multiple rest requests using YQL?

For example, I would like to combine several queries for query queries. I am currently doing the following code with different URLs one at a time. I think it would be faster to end up making 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;' 
+3
source share
1 answer

One possibility would be to create your own YQL table for this, which then runs the javascript that you need in the <execute>...</execute> block.

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

Not sure what does what you want, but you can try. Do not change the trailing label ("), it should remain immediately after the last semicolon (this was an error that I just struggled with for several 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';" 
+1
source

Source: https://habr.com/ru/post/1315326/


All Articles