我从Google新闻RSS Feed中获取Google新闻。网址是
http://news.google.com/news?pz=1&cf=all&ned=us&hl=en&topic=n&output=rss
这将归还所有美国头衔。
[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 ...
)
但我只想要来自加利福尼亚或XYZ的新闻。有没有办法在参数或任何其他解决方案中添加城市名称?谢谢。
答案 0 :(得分:0)
您只需在Url中更改ned
和hl
参数的值,就像关注网址一样,您可以看到不同的新闻。
http://news.google.com/news?pz=1&cf=all&ned=us&hl=en&topic=n&output=rss
西班牙语新闻
https://news.google.com/news/feeds?cf=all&ned=es_cu&hl=es&output=rss