Google 新闻 RSS 提要的 URL 格式 [英] URL format for Google News RSS feed

查看:83
本文介绍了Google 新闻 RSS 提要的 URL 格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google 于 2017 年 12 月 1 日弃用了旧的 RSS 提要 URL 格式(弃用通知),此外,他们还删除了 Google 新闻界面中的按钮以生成 RSS URL (提及此更改的新闻).

Google deprecated the old RSS feed URL format December 1st 2017 (deprecation notice), in addition to that they dropped the button in the Google News interface to generate a RSS URL (news mentioning this change).

这意味着没有生成新 RSS 链接的公开或记录方法.他们拥有的唯一文档已经过时,因为他们改变了界面.

This means that there is no public or documented method of generating a new RSS link. The only documentation they have is out of date since they changed the interface.

为 Google 新闻主题生成 RSS 提要的新格式是什么?

What is the new format for generating a RSS feed for a Google News topic?

推荐答案

找到了一个最新的库 (1) 使用 Google 新闻 RSS.

Found an up-to-date library (1) that uses Google News RSS.

URL 新格式似乎是:

The URL new format seems to be:

头条新闻:

https://news.google.com/news/rss

按主要主题:

https://news.google.com/news/rss/headlines/section/topic/{topic}

其中 {topic} 是以下值之一:WORLD NATION BUSINESS TECHNOLOGY ENTERTAINMENT SPORTS SCIENCE HEALTH

Where {topic} is one of the following values: WORLD NATION BUSINESS TECHNOLOGY ENTERTAINMENT SPORTS SCIENCE HEALTH

按任何/自定义主题:

https://news.google.com 上,浏览到所需的主题,例如 这个.在其 URL 中标识主题 ID,例如CAAqIQgKIhtDQkFTRGdvSUwyMHZNR056T1hFU0FtVnVLQUFQAQ,并使用格式:

Once at https://news.google.com, browse to the desired topic, for example this. Identify the topic ID in its URL, e.g. CAAqIQgKIhtDQkFTRGdvSUwyMHZNR056T1hFU0FtVnVLQUFQAQ, and use the format:

https://news.google.com/rss/topics/{id}?hl={lang}

在上面的格式中,本质上是在 https://news.google.com/ 之后添加了 rss/.

In the format above, essentially rss/ is added after https://news.google.com/.

按地理位置:

https://news.google.com/news/rss/headlines/section/geo/{location}

不确定 {location} 参数的格式

Not sure about the formatting for the {location} parameter

按搜索查询:

New link: https://news.google.com/rss/search?q={query}
Old link: https://news.google.com/news/rss/search/section/q/{query}

其中 {query} 参数是自由文本搜索

Where the {query} parameter is a free text search

指定国家和语言:

例如,如果您希望获得瑞典语新闻并来自瑞典语来源,请将以下查询字符串添加到 URL 以将国家/地区和语言更改为 sv-SE:?hl=sv&gl=SE&ceid=SE%3Asv

For example if you wish to have news in Swedish and located from Swedish sources, add the following query string to the URL to change country and language to sv-SE: ?hl=sv&gl=SE&ceid=SE%3Asv

这篇关于Google 新闻 RSS 提要的 URL 格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆