Unfortunately, I do not know how you can get a key pair => value in the response, where the key is the URL and the value is the html response. But you can try the following query and see if it matches your use case:
select * from yql.query.multi where queries="select * from html where url='http://www.whooma.net';select * from feed where url='http://www.dfdsfsdgsfagdffgd.com';select * from html where url='http://www.cnn.com'"
Try it here . What you can do before starting the query is to preserve the order in the url array in queries , for example like this ['http://www.whooma.net','http://www.dfdsfsdgsfagdffgd.com','http://www.cnn.com'] . We can call this array A When you iterate over a response from a YQL query, a url that does not exist will return null. Sample response from the above request:
<results> <results> // Response from select * from html where url='http://www.whooma.net'. This should be some html </results> <results> // Response from select * from feed where url='http://www.dfdsfsdgsfagdffgd.com'. This should be null. </results> <results> // select * from html where url='http://www.cnn.com'. This should also be some html </results> </results>
So in conclusion, you can iterate over array A and the response from YQL. The first element of array A must match the first element of results (internal result) of this YQL response. You create a hash map from two arrays. I know the answer is long, but I think it was necessary. Let me know if there is any confusion.
source share