Google新闻Feed网址不适用于Google Feed API

时间:2013-05-23 01:01:38

标签: jquery google-feed-api google-news

如果我将以下网址与Google Feed API一起使用,则无效;

http://news.google.co.in/news?hl=en&gl=in&q=something&um=1&ie=UTF-8&output=atom

OR

http://news.google.co.in/news?hl=en&gl=in&q=something&um=1&ie=UTF-8&output=rss

它给了我null。然而,任何其他网站的RSS工作完美。我正在使用jGFeed。

(function($){
  $.extend({
    jGFeed : function(url, fnk, num, key){
      // Make sure url to get is defined
      if(url == null) return false;
      // Build Google Feed API URL
      var gurl = "http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?&q="+url;
      if(num != null) gurl += "&num="+num;
      if(key != null) gurl += "&key="+key;
      // AJAX request the API
      $.getJSON(gurl, function(data){
        if(typeof fnk == 'function')
                  fnk.call(this, data.responseData.feed);
                else
                  return false;
      });
    }
  });
})(jQuery);

我尝试了什么错?

0 个答案:

没有答案