function BlogPreview(_1){
this.container_=_1;
};
BlogPreview.prototype.show=function(_2,_3,_4,_5){
var _6=new google.feeds.Feed(_2);
var _7=this;
_6.setNumEntries(_3);
_6.load(function(_8){
_7.render_(_8,_4,_5);
});
};
BlogPreview.prototype.render_=function(_9,_a,_b){
if(!_9.feed||!_9.feed.entries){
return;
}
while(this.container_.firstChild){
this.container_.removeChild(this.container_.firstChild);
}
var _c=this.createDiv_(this.container_,"blog");
var _d=this.createElement_("h2",_c,"");
if(!_a){
_a=_9.feed.title;
}
if(!_b){
_b=_9.feed.link;
}
this.createLink_(_d,_b,_a);
for(var i=0;i<_9.feed.entries.length;i++){
var _e=_9.feed.entries[i];
var _f=this.createDiv_(_c,"entry");
var _10=this.createDiv_(_f,"title");
this.createLink_(_10,_e.link,_e.title);
if(_e.author){
this.createDiv_(_f,"author","Posted by "+_e.author);
}
this.createDiv_(_f,"snippet",_e.contentSnippet);
}
};
BlogPreview.prototype.createDiv_=function(_11,_12,_13){
return this.createElement_("div",_11,_12,_13);
};
BlogPreview.prototype.createLink_=function(_14,_15,_16){
var _17=this.createElement_("a",_14,"",_16);
_17.href=_15;
return _17;
};
BlogPreview.prototype.createElement_=function(_18,_19,_1a,_1b){
var div=document.createElement(_18);
div.className=_1a;
_19.appendChild(div);
if(_1b){
div.appendChild(document.createTextNode(_1b));
}
return div;
};

