//<![CDATA[

google.load("feeds", "1");

function initialize() {
	var mynow = new Date();
	var q = mynow.getMonth(); //月を取得
	var q2 = mynow.getDate(); //日にちを取得
	var q3 = mynow.getHours(); //時間を取得
	var query = q+"0"+q2+"0"+q3; //月日時間を合体。なんとなく間に0を追加
	var feedurl = new Array("http://taiheime.blog83.fc2.com/?xml"+"&"+query);

  var feed = new google.feeds.Feed(feedurl);
  feed.setNumEntries(10);
  feed.load(dispfeed);

  function dispfeed(result){
    if (!result.error){
      var container = document.getElementById("feed_taihei");
      var htmlstr = "";
           
      for (var i = 0; i < result.feed.entries.length; i++) {
	  
        var entry = result.feed.entries[i];
        var strdate = createDateString(entry.publishedDate);
		htmlstr += '<dl class="t_rss01">';
        htmlstr += '<dt class="rss_title02">';
        htmlstr += strdate;
		htmlstr += "</dt>";
	
		htmlstr += "<dd>";
        htmlstr += '<a href="' + entry.link + '">' + entry.title + '</a>';
		htmlstr += "</dd>";
      	htmlstr += "</dl>";

      }

       container.innerHTML = htmlstr;
    }else{
       alert(result.error.code + ":" + result.error.message);
    }
  }
}

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 strdate = pyear + "/" + pmonth + "/" + pday;
//2009/01/30,
  return strdate;
}

google.setOnLoadCallback(initialize);

    //]]>

