text: !function(e){var t={};e.fn.feeds=function(n){var r={service:"//ajax.googleapis.com/ajax/services/feed/load?v=1.0",settings:{loadingTemplate:'<div class="feeds-loader">Loading entries ...</div>',entryTemplate:'<div class="feeds-entry feeds-source-<!=source!>"><a class="feeds-entry-title" target="_blank" href="<!=link!>" title="<!=title!>"><!=title!></a><div class="feeds-entry-date"><!=publishedDate!></div><div class="feeds-entry-contentSnippet"><!=contentSnippet!></div></div>',feeds:{},max:-1,xml:!1,ssl:"auto",onComplete:function(){},preprocess:function(){}},feeds:{},entries:[],feedsLength:0,feedsLoaded:0,$element:null,$loader:null,init:function(t,n){this.settings=e.extend(this.settings,n),this.feeds=this.settings.feeds;for(var r in this.feeds)this.feeds.hasOwnProperty(r)&&this.feedsLength++;var i="auto"===this.settings.ssl?document.location.protocol:this.settings.ssl?"https:":"http:";e.inArray(i,["http:","https"])===-1&&(i="https:"),this.service=i+this.service,this.$element=e(t);var o="function"==typeof this.settings.loadingTemplate?this.settings.loadingTemplate:this.tmpl(this.settings.loadingTemplate);this.$loader=e(o.call(this,{})),this.$element.html(this.$loader);var a=this.settings.xml?"json_xml":"json";for(var s in this.feeds)this.fetchFeed(s,this.feeds[s],this.settings.max,a)},fetchFeed:function(n,r,i,o){var a=this,s=r+"**"+i+"**"+o;return"undefined"!=typeof t[s]?void a.processResponse(t[s],n,r):void e.ajax({url:this.service,dataType:"jsonp",data:{q:r,num:i,output:o},beforeSend:function(){this.feed=r,this.key=n},success:function(e){t[s]=e,a.processResponse(e,this.key,this.feed)}})},processResponse:function(t,n,r){if(200!==t.responseStatus)window.console&&window.console.log&&console.log("Unable to load feed "+r+": ("+t.responseStatus+") "+t.responseDetails);else{var i=t.responseData.feed,o=i.entries,a=t.responseData.feed.type;if(this.settings.xml){var s=e(t.responseData.xmlString);a.match(/^rss.*/)?s=s.filter("rss").find("channel"):a.match(/^atom.*/)&&(s=s.filter("feed")),i.xml=s}for(var l in o){var u=e.extend({},o[l]);u.source=n,u.publishedDateRaw=u.publishedDate,u.feedUrl=i.feedUrl,u.feedTitle=i.title,u.feedLink=i.link,u.feedDescription=i.description,u.feedAuthor=i.author,this.settings.xml&&(a.match(/^rss.*/)?u.xml=i.xml.find("item").eq(l):a.match(/^atom.*/)?u.xml=i.xml.find("entry").eq(l):u.xml={}),this.settings.preprocess.call(u,i)!==!1&&this.entries.push(u)}}this.feedsLoaded++,this.checkComplete()},checkComplete:function(){if(this.feedsLoaded===this.feedsLength){this.$loader.remove(),this.entries.sort(function(e,t){var n=new Date(e.publishedDateRaw).getTime(),r=new Date(t.publishedDateRaw).getTime();return r-n});var e="function"==typeof this.settings.entryTemplate?this.settings.entryTemplate:this.tmpl(this.settings.entryTemplate);for(var t in this.entries){var n=this.entries[t],r=e.call(this,n);this.$element.append(r)}this.settings.onComplete.call(this.$element[0],this.entries)}},tmplCache:{},tmpl:function(e,t){var n=/\W/.test(e)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+e.replace(/[\r\t\n]/g," ").split("<!").join("\t").replace(/((^|!>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)!>/g,"',typeof $1 != 'undefined' ? $1 : '','").split("\t").join("');").split("!>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):this.tmplCache[e]=this.tmplCache[e]||this.tmpl(document.getElementById(e).innerHTML);return t?n(t):n}};return e(this).each(function(){r.init(this,n)})}}(jQuery);