揀.食嘢💛 | FOODIE PICK 更多 »
訂閱:
文章 (Atom)
No posts found.
'; } } document.addEventListener("DOMContentLoaded", function() { // Fetch posts for PARTY PICK const partyLabel = "香港-美食地圖-派對到會"; // Specify your label here const partyUrl = `https://kansbestpick.com/feeds/posts/default/-/${encodeURIComponent(partyLabel)}?alt=json-in-script&callback=displayPartyPosts`; // Create a script element to fetch the JSONP data for PARTY PICK const partyScript = document.createElement('script'); partyScript.src = partyUrl; document.body.appendChild(partyScript); }); function displayPartyPosts(data) { const container = document.querySelector("#party-food .home-card-container"); // Targeting the card-container in PARTY PICK section // Clear existing content container.innerHTML = ''; // Check if there are entries if (data.feed.entry) { const numPosts = Math.min(data.feed.entry.length, 3); // Limit to 3 posts for (let i = 0; i < numPosts; i++) { const entry = data.feed.entry[i]; const title = entry.title.$t; // Get the post title const imageUrl = entry.media$thumbnail ? entry.media$thumbnail.url.replace(/\/s[0-9]+/, '/s800') : 'https://via.placeholder.com/800'; // Default image if none available const postUrl = entry.link.find(link => link.rel === 'alternate').href; // Extract post URL // Create card element const card = document.createElement('div'); card.className = 'home-card'; // Add a class for styling // Add image, title, and button to the card card.innerHTML = `No posts found.
'; } } document.addEventListener("DOMContentLoaded", function() { // Fetch posts for JETSO PICK const jetsoLabel = "揀飲簡食記讀者尊享-獨家優惠"; // Specify your label here const jetsoUrl = `https://kansbestpick.com/feeds/posts/default/-/${encodeURIComponent(jetsoLabel)}?alt=json-in-script&callback=displayJetsoPosts`; // Create a script element to fetch the JSONP data for JETSO PICK const jetsoScript = document.createElement('script'); jetsoScript.src = jetsoUrl; document.body.appendChild(jetsoScript); }); function displayJetsoPosts(data) { const container = document.querySelector("#jetso .home-card-container"); // Targeting the card-container in JETSO PICK section // Clear existing content container.innerHTML = ''; // Check if there are entries if (data.feed.entry) { const numPosts = Math.min(data.feed.entry.length, 3); // Limit to 3 posts for (let i = 0; i < numPosts; i++) { const entry = data.feed.entry[i]; const title = entry.title.$t; // Get the post title const imageUrl = entry.media$thumbnail ? entry.media$thumbnail.url.replace(/\/s[0-9]+/, '/s800') : 'https://via.placeholder.com/800'; // Default image if none available const postUrl = entry.link.find(link => link.rel === 'alternate').href; // Extract post URL // Create card element const card = document.createElement('div'); card.className = 'home-card'; // Add a class for styling // Add image, title, and button to the card card.innerHTML = `No posts found.
'; } } document.addEventListener("DOMContentLoaded", function() { // Fetch posts for I'M LOLLYPOP const lollypopLabel = "香港-本地音樂-廣東歌-Lolly Talk"; // Specify your label here const lollypopUrl = `https://kansbestpick.com/feeds/posts/default/-/${encodeURIComponent(lollypopLabel)}?alt=json-in-script&callback=displayLollypopPosts`; // Create a script element to fetch the JSONP data for I'M LOLLYPOP const lollypopScript = document.createElement('script'); lollypopScript.src = lollypopUrl; document.body.appendChild(lollypopScript); }); function displayLollypopPosts(data) { const container = document.querySelector("#lollytalk-lollipop .home-card-container"); // Targeting the card-container in I'M LOLLYPOP section // Clear existing content container.innerHTML = ''; // Check if there are entries if (data.feed.entry) { const numPosts = Math.min(data.feed.entry.length, 3); // Limit to 5 posts for (let i = 0; i < numPosts; i++) { const entry = data.feed.entry[i]; const title = entry.title.$t; // Get the post title const imageUrl = entry.media$thumbnail ? entry.media$thumbnail.url.replace(/\/s[0-9]+/, '/s800') : 'https://via.placeholder.com/800'; // Default image if none available const postUrl = entry.link.find(link => link.rel === 'alternate').href; // Extract post URL // Create card element const card = document.createElement('div'); card.className = 'home-card'; // Add a class for styling // Add image, title, and button to the card card.innerHTML = `No posts found.
'; } } -->No posts found.
'; } } -->No posts found.
'; } } -->No posts found.
'; } } -->