I’m using YQL to retrieve several RSS feeds (channels) at once, using the following query:
SELECT * FROM feednormalizer
WHERE output="rss_2.0"
AND url in ("http://rss.cnn.com/rss/edition.rss",
"http://bad.url.com/nothing",
"http://rss.cnn.com/rss/edition_space.rss")
so i actually have 2 questions:
- How can i limit each feed to a certain amount of items? (for example, I want to get top 3 items from each channel)
- Notice that the 2nd URL is invalid (not a URL of a real RSS). in that case, the YQL result returns 2 valid channels plus an error, but there is no indication of which URLs are valid and which one failed.
in other words – for each result feed, there is no indication from which URL it arrived.
any ideas as to how identify each channel?
thanks
1st question:
the first thought that comes to mind is using
query.multi:Not the most elegant way but it works.
2nd question:
I don’t think it is possible. As YQL’s
WHERE x IN ()...syntax is not really an SQL join, it is not possible to select parts of the inner subquery in the projection, what you would need for your case.Would be happy if anybody would proove me wrong on this one, as I needed that a couple of times myself and always had to work around it programatically 🙂