Question

I am fetching Google news from Google News RSS feed. The URL is

http://news.google.com/news?pz=1&cf=all&ned=us&hl=en&topic=n&output=rss

This return all US titles.

[0] => Array
    (
        [title] => Transportation Safety Board Team Probes N.Y. Ferry Crash - Bloomberg
        [link] => http://news.google.com/news/url?sa=t&fd=R&usg=AFQjCNGDVYrS8J_SXHtPWyYXxxXyKkNaRw&url=http://www.bloomberg.com/news/2013-01-10/transportation-safety-board-team-probes-n-y-ferry-crash.html
        [image] => //nt3.ggpht.com/news/tbn/t9HUK7dtkbtFrM/6.jpg
        [site_title] => Bloomberg
        [story] => The National Transportation Safety Board began an investigation of the rush-hour commuter ferry crash near Manhattan's financial district that sent passengers flying and injured dozens. The NTSB sent an 11-member “go team†to New York yesterday to ...
    )

[1] => Array
    (
        [title] => Obama Cabinet may not meet his own diversity standards - Los Angeles Times
        [link] => http://news.google.com/news/url?sa=t&fd=R&usg=AFQjCNGSgKCy6djWVzzCkvphxbK-anvjlw&url=http://www.latimes.com/news/nationworld/nation/la-na-obama-administration-20130110,0,4200106.story
        [image] => //nt2.ggpht.com/news/tbn/CtM74UExtG_E7M/6.jpg
        [site_title] => Los Angeles Times
        [story] => WASHINGTON — Wednesday's "photo of the day" on the White House website showed an unusual sight in Oval Office history — the president surrounded by top advisors, only half of whom are white men. The picture seemed calculated to counter criticism ...
    )

[2] => Array
    (
        [title] => Chris Christie: Master of Disaster - TIME
        [link] => http://news.google.com/news/url?sa=t&fd=R&usg=AFQjCNErxzRlmXjDZOAvqU0hMIwYspcnpg&url=http://swampland.time.com/2013/01/09/chris-christie-master-of-disaster/
        [image] => //nt3.ggpht.com/news/tbn/XyB4G4Cfox0EOM/6.jpg
        [site_title] => TIME
        [story] => This morning on NBC's Today Show, Chris Christie reacted to being on the brand new cover of TIME. The full cover story will be available on time.com later today and on newsstands Friday. Gov. Christie was featured as one of 13 members in TIME's Class of ...
    )

But I just want the news from California or XYZ. Is there a way to add a city name in parameter or any other solution? Thank you.

Was it helpful?

Solution

You need to just change value of ned and hl parameters in Url like following url you can see different news .

http://news.google.com/news?pz=1&cf=all&ned=us&hl=en&topic=n&output=rss

Spanish News

https://news.google.com/news/feeds?cf=all&ned=es_cu&hl=es&output=rss
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top