Reputation: 2453
I'm using YQL to retrieve RSS and ATOM feeds as JSON, and normalize them to ATOM style using the feednormalizer table.
I need to get only the first X entries. I know that, in theory, an xpath expression should be able to do that. However, when I try one that I assume ought to work...
...the results object comes back null. I've also tried using item instead of entry in the xpath query, since that's what an RSS feed will have in the actual XML. That also returns a null results object.
I've also tried using both local and remote limits, which returns the same number of entries as if I hadn't specified a limit.
Notably, I still need all the metadata that comes with the typical select *
query. That is, I need the feed's title, link, etc., and I'd prefer they stayed at the root element. So, I know that I can do
select title, link, entry from feednormalizer(0,6) where output='atom_1.0' AND url='http://feeds.delicious.com/v2/rss/msuweb'
or
select title, link, entry from feednormalizer where output='atom_1.0' AND url='http://feeds.delicious.com/v2/rss/msuweb' limit 6
But that puts the title and feed link directly onto each entry in the list, even with crossProduct=optimized
in the URL string. Call me picky, but I'd rather not do that.
Upvotes: 2
Views: 681
Reputation: 1355
Might be really late but for others like me that had the same question, I finished by doing 2 requests. The first one for meta data:
select * from feednormalizer
where output='atom_1.0'
AND url='http://feeds.delicious.com/v2/rss/msuweb'
and the second one to limit the data:
select title, link, entry
from feednormalizer(0,6)
where output='atom_1.0'
AND url='http://feeds.delicious.com/v2/rss/msuweb'
! Not optimized but works !
Upvotes: 0