Subversion-Projekte lars-tiefland.cienc

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
9 lars 1
/*
2
 * jGFeed 1.0 - Google Feed API abstraction plugin for jQuery
3
 *
4
 * Copyright (c) 2009 jQuery HowTo
5
 *
6
 * Licensed under the GPL license:
7
 *   http://www.gnu.org/licenses/gpl.html
8
 *
9
 * URL:
10
 *   http://jquery-howto.blogspot.com
11
 *
12
 * Author URL:
13
 *   http://me.boo.uz
14
 *
15
 */
16
(function($){
17
  $.extend({
18
    jGFeed : function(url, fnk, num, key){
19
      // Make sure url to get is defined
20
      if(url == null) return false;
21
      // Build Google Feed API URL
22
      var gurl = "http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?&q="+url+"?";
23
      if(num != null) gurl += "&num="+num;
24
      if(key != null) gurl += "&key="+key;
25
      // AJAX request the API
26
      $.getJSON(gurl, function(data){
27
        if(typeof fnk == 'function')
28
                  fnk.call(this, data.responseData.feed);
29
                else
30
                  return false;
31
      });
32
    }
33
  });
34
})(jQuery);