`;
blogPostsContainer.insertAdjacentHTML("beforeend", HTMLCode);
};
const populateAllPosts = (posts) => {
posts.forEach((post) => {
let postLink = post.link[post.link.length - 1].href;
let thumbUrl = post.media$thumbnail ? post.media$thumbnail.url.replace('/s72','/s400') : 'https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEil97XPZR8bwNV3d8w14BbSLliywoxQ3AfGtYI-cMEiOyBGy5m-i9E5hXaGN14-ZIn21MKeonNevJp_ua7kv4NKbuiGtaWTeaHeuxIetvNYGayxc9ocGgQK2Er6KciMoaVGeC0WWbbwqAOyNne_By9vOmmxSH-q-xo9lGzTZZNOX8U8SD0C125Vlnx_Ags/w452-h640/Danke%20Coffee%E3%81%AE%E3%82%B3%E3%83%94%E3%83%BC.png' ;
let category = post.category ? post.category[0].term : 'Uncategorized';
let categoryLink = post.categoryLink;
let title = post.title.$t;
let summary = post.summary.$t;
let author = post.author;
let datePublished = post.datePublished;
createPostDiv(
postLink,
thumbUrl,
category,
categoryLink,
title,
summary,
author,
datePublished
);
});
};
const fetchAllPosts = (data) => {
populateAllPosts(data.feed.entry);
}