lehn0058
lehn0058

Reputation: 20237

How do you specify retrieving local news when using a Google News RSS URL?

I am trying to build an RSS parser that users Google News RSS. I am able to retrieve news articles from the news URL just by targeting the following URL:

https://news.google.com/news/section?output=rss

However, on the google news page their is an option to retrieve news near your current location. This URL in the browser is:

https://news.google.com/news/section?geo=detect_metro_area

Just adding the output=rss query string parameter is not enough to return the local news in RSS format. Instead, I get a pretty much empty response:

<rss version="2.0">
<channel>
<generator>NFE/1.0</generator>
<title>News near you - Google News</title>
<link>
http://news.google.com/news?pz=1&ned=us&hl=en&geo=detect_metro_area
</link>
<language>en</language>
<webMaster>[email protected]</webMaster>
<copyright>&copy;2012 Google</copyright>
<pubDate>Tue, 20 Nov 2012 19:32:04 GMT</pubDate>
<lastBuildDate>Tue, 20 Nov 2012 19:32:04 GMT</lastBuildDate>
<image>
<title>News near you - Google News</title>
<url>
https://ssl.gstatic.com/news/img/logo/en_us/news.gif
</url>
<link>
http://news.google.com/news?pz=1&ned=us&hl=en&geo=detect_metro_area
</link>
</image>
<description>Google News</description>
</channel>
</rss>

Does anyone know if their is a way to get news that is near you geographically from this RSS feed?

Upvotes: 5

Views: 6303

Answers (2)

Dennis
Dennis

Reputation: 482

Replace ?geo=detect_metro_area with ?geo=Zip Code

Such as https://news.google.com/news/section?geo=90210

For RSS it would be https://news.google.com/news/feeds?geo=90210&output=rss

Upvotes: 1

Bryan Roberts
Bryan Roberts

Reputation: 3479

As far as I can tell you will need to determine that your self since the website is required to automatically determine your location using an on device mechanism or logged in user account. However if you would like to query based on news containing a city or area you could do something like this for New York. If you combine that for some on device geo location functions then you should be able to get news for what you would like.

https://news.google.com/news/section?output=rss&q=New%20York

Upvotes: 2

Related Questions