本文介绍了RSS 谷歌新闻语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建来自 Google 新闻的 RSS 提要,到目前为止它可以正常工作,但我想获取 2 种语言的新闻,而不仅仅是英语

I am creating a RSS feed from Google News and it's working so far, but I'd like to get news from 2 languages, not just English

这是我目前的 RSS 网址:

This is my RSS URL so far:

https://news.google.com/rss/search?q=能源+效率

它工作正常,只需要添加 2 种语言过滤器(德语 + 英语)

It's working fine, just need to add the 2 languages filter (German + English)

这是我在不同博客中发现的内容,但我不想按位置过滤新闻,只按语言:

This is what I've found in different blogs, but I do not wish to filter the news by location, just by language:

如果您希望获得来自美国来源的英文新闻,请将以下查询字符串添加到 URL 以更改国家/地区和语言:"

"If you wish to have news in English and located from the United States sources, add the following query string to the URL to change country and language:"

&hl=en-US&gl=US&ceid=US:en

&hl=en-US&gl=US&ceid=US:en

无论我怎么修改上面的网址,都会报错...

No matter how I modify the above URL, I get an error...

推荐答案

在阅读了大量帖子并尝试之后,我找到了解决方案.

After reading lots of posts and playing around, I found the solution.

如果有人需要它:https://news.google.com/rss?q=energy+效率&hl=en

在链接末尾添加语言代码:

Add the language code at the end of the link:

&hl=en//英文

&hl=en //English

&hl=de//德语

&hl=de //German

这篇关于RSS 谷歌新闻语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-21 13:28
查看更多