function showFeed() {
var feed = new google.feeds.Feed("http://rss.exblog.jp/rss/exblog/konajikan/index.xml");
feed.load(
function(result) {
if (result.error) {
return;
}
var html = '
';
html+='
'+getYmd(new Date(entry.publishedDate))+' 更新';
html+=''+getTitle(entry)+'
';
if(image!=null){
html+='

';
}
html+='
'+getContent(entry)+' >>続きを読む
';
html+='
';
return html;
}
function getTitle(entry) {
return cut(entry.title,15);
}
function getContent(entry) {
return cut(entry.contentSnippet,25);
}
function cut(str,length) {
if(str.length<=length){
return str;
}
return str.substring(0,length)+"…";
}
function getImage(content) {
return null;
var url = /((?:\w+):\/\/(?:[\w.]+)\/(?:[^\t\n\r\f\s"'<>]*))/;
var image = content.match(url);
if(image!=null){
return image[0];
}
return null;
}
function getYmd(date) {
var year = date.getYear();
if(year<1000) year+=1900;
return year+"/"+(date.getMonth()+1)+"/"+date.getDate();
}
google.load("feeds", "1");
google.setOnLoadCallback(showFeed);