看到 YQL 被宣传为一种很好的做事方式,我很好奇如何使用 YQL 获取并合并 2 个不同的提要(按 pubDate 排序)。
获取 2 个提要非常简单,但事实证明这些提要只是连接在一起而不是合并。
这是示例代码。
select channel.title,channel.link,channel.item.title,channel.item.link
from xml where url in(
'http://code.flickr.com/blog/feed/rss/',
'http://feeds.delicious.com/v2/rss/codepo8?count=15',
'http://www.stevesouders.com/blog/feed/rss',
'http://www.yqlblog.net/blog/feed/',
'http://www.quirksmode.org/blog/index.xml'
)
最佳答案
感谢您提供此信息。它也适用于访问 rss 对象:
select title,link,pubDate from rss where url in (
'http://feeds.delicious.com/v2/rss/hasematzel?count=3',
'http://oliverschwarz.tumblr.com/rss',
'http://twitter.com/statuses/user_timeline/818226.rss',
'http://hasematzel.de/blog/feed/',
'http://piepmatzel.de/feed/'
) | sort(field="pubDate", descending="true")
这是创建新闻编辑室或生活流的一种非常简单的方法。不要忘记强制缓存 YQL 返回 :)
关于rss - 如何使用 YQL 合并 2 个按 pubDate 排序的 RSS 提要?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2718575/