Unfortunately, I do not know a way where you can get a key=>value pair in the response where key being the url and value being the html response. But, you can try the following query and see if it meets 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 is before firing the query, maintain the order in an array of the url
in the queries
like so
['http://www.whooma.net','http://www.dfdsfsdgsfagdffgd.com','http://www.cnn.com']
. We can call this array A
When you iterate over the response from the YQL query, the url which does not exists will return a null. A sample response from the above query:
<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 response from YQL. The first element of array A
should correspond to the first results
(inner results) element of that YQL response. i.e You are creating a hashmap from two arrays. I know the answer is long but I think it was needed. Let me know if there is any confusion.