Extract top 10 news from google news
I am trying to extract top N (say 10) results from a google news(http://news.google.com/) by taking an query as input, but couldn't do so. Google doesn't allow to query server through scripts. I looked at google news api, but what i understood from there is that, it allows us to display "google news results" in our website according开发者_如何转开发 to some query. I want to extract the news or say the hyperlinks pointing to the news.
You can pull a feed of news based on a query by using this url
http://news.google.com/news?pz=1&cf=all&ned=usa&hl=en&q=yoursearchterm&cf=all&output=rss
This will allow you to get an rss feed which can then be parsed and used by your application. While this is possible I would check the small print on Google's website as I think there are restrictions as to what you can do with this data. You would certainly have to give credit to Google and the news sources wherever you used the info.
I hope this helps.
精彩评论