google.load("feeds", "1");
 
function initialize() {
  var feed = new google.feeds.Feed("http://blog.niwablo.jp/toumatu-ex/rss");
  feed.setNumEntries(10);
  feed.load(function(result) {
	if (!result.error) {
	  var container = document.getElementById("feed");
	  var ul = document.createElement("ul"); 
	   for (var i = 0; i < result.feed.entries.length; i++) {  
			 var entry = result.feed.entries[i];  
			  
			 var li = document.createElement("li");  
			 var a = document.createElement("a"); 
			 var span = document.createElement("span"); 
			 a.href = entry.link;
			 
			 var year = entry.publishedDate.substring(12, 16) + "/";
			 var month = entry.publishedDate.substring(8, 11);
			 var date = entry.publishedDate.substring(5, 7) + " : ";
			 
			if(month=="Jan") month = "01";
			if(month=="Feb") month = "02";
			if(month=="Mar") month = "03";
			if(month=="Apr") month = "04";
			if(month=="May") month = "05";
			if(month=="Jun") month = "06";
			if(month=="Jul") month = "07";
			if(month=="Aug") month = "08";
			if(month=="Sep") month = "09";
			if(month=="Oct") month = "10";	
			if(month=="Nov") month = "11";
			if(month=="Dec") month = "12";
			
			month = month + "/";
			 
			 
			 span.appendChild(document.createTextNode(year + month + date));  
			 li.appendChild(span); 
			 
			 var list = entry.title ;  
			 a.appendChild(document.createTextNode(list));  
			 li.appendChild(a); 
			 ul.appendChild(li); 
		}
		container.appendChild(ul); 
	}
  });
}
google.setOnLoadCallback(initialize);
