');
$('item', data).each(function(i) {
var link = $('link', this).text();
var title = $('title', this).text();
var image = $('image', this).text();
var content = $('content\\:encoded', this).text();
var date = dateSetFunc($("pubDate", this).text());
var blog_content = '
';
if(i === 6) {
return false;
};
$('#js-rss').find('.p-blog__list').append(blog_content);
});
});
});
function dateSetFunc(str) {
var objDate = new Date(str);
var y = objDate.getFullYear();
var m = twoDigit(objDate.getMonth() + 1);
var d = twoDigit(objDate.getDate());
var ymd = y + "." + m + "." + d;
str = ymd;
return str;
}
function twoDigit(d) {
d = "0" + d;
d2 = d.substr(d.length - 2, 2);
return d2;
}