google.load("feeds", "1");

function initialize() {
var feed = new google.feeds.Feed("http://swedenavi.com/blog/feed/rdf");
feed.setNumEntries(1);
feed.load(function(result) {
if (!result.error) {
var html = '<ul>';
var container = document.getElementById("feed");
for (var i = 0; i < result.feed.entries.length; i++) {
var entry = result.feed.entries[i];
html += '<li id="day">';
var strdate = createDateString(entry.publishedDate);
html += "" + strdate + "";
html += '</li>';
html += '<li id="title">';
html += '<a href="' + "blog/" + '">' + entry.title.substr(0,10) + '...</a>';
html += '</li>';
html += '<li id="summary">';
html += '' + entry.contentSnippet.substr(0,38) + '' + '<span>、、、<a href="' + "blog/" + '"> ブログTOP≫</a></span>';
html += '</li>';
}
html += '</ul>';
container.innerHTML = html;
}
});
}

function createDateString(publishedDate){
  var pdate = new Date(publishedDate);
  var pday = pdate.getDate();
　if (pday < 10) {pday = "0" + pday;}
  var pmonth = pdate.getMonth() + 1;
　if (pmonth < 10) {pmonth = "0" + pmonth;}
  var pyear = pdate.getFullYear();
  var phour = pdate.getHours();
  var pminute = pdate.getMinutes();
  var psecond = pdate.getSeconds();
  var strdate = pyear + "年" + pmonth + "月" + pday + "日" ;
  return strdate;
}

google.setOnLoadCallback(initialize);
