
$(document).ready(function(){

	var pubDate;
	var category;
	var title;
	var link;
	var html = '';

	$.ajax({
		type: 'GET',
		url:'./library/rssWhats/proxy.php',
    data:null,
		dataType: 'xml',
		success: function(xml) {
			$(xml).find('item').each(function(i){
				pubDate = $(this).find('pubDate').text();
				category = $(this).find('category').text();
				title = $(this).find('title').text();
				link = $(this).find('link').text();

				mydate = new Date(pubDate);
				yy = mydate.getFullYear();
				mm = mydate.getMonth() + 1;
				dd = mydate.getDate();
				if (mm < 10) { mm = "0" + mm; }
				if (dd < 10) { dd = "0" + dd; }
				pubDate = yy + "/" + mm + "/" + dd;

//			html += '<dt>' + pubDate + '　<a href="' + link + '">' + category + '</a><\/dt><dd>' + title + '<\/dd>';
				html += '<dt>' + pubDate + '<\/dt><dd><a href="' + link + '">' + title + '</a><\/dd>';
			});
			$('div.whats div.list dl').append(html);
		}
	});

});

