2014-03-29 81 views
2

谷歌包括以下规定使用有RSS新闻:如何获取Google新闻RSS Feed中的相关文章群集?

包括一个链接到每个 条新闻相关报道的谷歌新闻组,使用在谷歌新闻源提供的链接。

此链接应该包含与当前项目相关的其他文章的集合。一个在有RSS源的每个节点上的XML属性的东西,看起来像这样:

<guid isPermaLink="false">tag:news.google.com,2005:cluster=43982360597436</guid> 

不过,我无法弄清楚如何使用它来获取相关文章列表。有谁知道如何做到这一点?

回答

1

您需要查看RSS源的顶部,特别是包含链接到新闻群集的<link>节点。

例如:

<rss version="2.0"> 
    <channel> 
    <generator>NFE/1.0</generator> 
    <title>Google News</title> 
    <link>http://news.google.com/news?pz=1&ned=us&hl=en&topic=snc&ncl=dd_4rHFR0wfHJ5M35r9VmSXgpLESM</link> 
    <language>en</language> 
    <webMaster>[email protected]</webMaster> 
    <copyright>&amp;copy;2014 Google</copyright> 
    <pubDate>Tue, 19 Aug 2014 03:31:53 GMT</pubDate> 
    <lastBuildDate>Tue, 19 Aug 2014 03:31:53 GMT</lastBuildDate> 
    ... 

这里,<link>节点的URL会带你到a page showing all related articles形成的消息簇。

+0

哇......我从来没有想过要去看那个领域。谢谢! – lehn0058