1

如果我将以下 URL 与 Google feed api 一起使用,它就不起作用;

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

或者

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

它给了我空值。然而,任何其他网站的 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);

我在尝试什么问题?

4

0 回答 0