5

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>news-feedback@google.com</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?

lehn0058
  • 19,977
  • 15
  • 69
  • 109
  • 1
    It looks like I can get close by adding a nearby city's name in the geo query parameter, like this: https://news.google.com/news/section?output=rss&geo=Boston, though I would still like to have the webservice figure out the city as part of the query... – lehn0058 Nov 20 '12 at 21:04

2 Answers2

2

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

Bryan Roberts
  • 3,449
  • 1
  • 18
  • 22
  • I could possibly do it that way, but the RSS feed is able to figure out where the user is from the browser's location settings. I am hoping to find a way to be able to have the RSS service figure out what news is nearby, assuming it has been given permission to use the user's current location. – lehn0058 Nov 20 '12 at 20:45
1

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

Dennis
  • 482
  • 7
  • 17