//BLOG FEED
google.load("feeds", "1");
function initialize() {
  var list = "";
  var feed = new google.feeds.Feed("http://2nd-ed.com/blog/atom.xml"+"?"+(new Date()).getTime());
  //var feed = new google.feeds.Feed("http://2nd-ed.com/blog/atom.xml");
  feed.setNumEntries(5);
  feed.load(function(result) {
    if (!result.error) {
      list = '<ul>';
      list += '<li class="title"><img src="images/title_topics.gif" width="57" height="18" alt="TOPICS" /></li>';
      for (var i = 0; i < result.feed.entries.length; i++) {
        var entry = result.feed.entries[i];
        var strdate = createDateString(entry.publishedDate);
        list += '<li>';
        list += '<div class="in1"><a href="' + entry.link + '">' + entry.title + '</a></div>';
        list += '<div class="in2">' + strdate + '</div>';
        list += '</li>';
      }
      list += '</ul>';
      list += '<div id="feed_button"><a href="http://2nd-ed.com/blog/atom.xml">このブログを購読</a></div>';
    }
    var container = document.getElementById("feed");
    container.innerHTML = list;
  }); 
}
function createDateString(publishedDate) {
  var pdate = new Date(publishedDate);
  var pday = pdate.getDate();
  var pmonth = pdate.getMonth() + 1;
  var pyear = pdate.getFullYear();
  var phour = pdate.getHours();
  var pminute = pdate.getMinutes();
  var psecond = pdate.getSeconds(); 
  //var strdate = pyear + "年" + pmonth + "月" + pday + "日" + phour + "時" + pminute + "分" + psecond + "秒";
  var strdate = pyear + "." + pmonth + "." + pday ;
  return strdate;
} 
google.setOnLoadCallback(initialize);

