Gallery
A peek at Ceci’s cakes
Live from Instagram once connected. Replace the placeholder token + user ID in the script below to pull your latest posts.
Instagram feed not connected yet.
Gallery
Live from Instagram once connected. Replace the placeholder token + user ID in the script below to pull your latest posts.
Instagram feed not connected yet.
${item.caption}
`; galleryGrid.appendChild(article); }); } async function loadInstagramFeed(){ if(!INSTAGRAM_ACCESS_TOKEN || INSTAGRAM_ACCESS_TOKEN.startsWith("PLACEHOLDER")){ setStatus("Add your Instagram access token to load the live feed."); renderFallback(); return; } if(!INSTAGRAM_USER_ID || INSTAGRAM_USER_ID.startsWith("PLACEHOLDER")){ setStatus("Add your Instagram user ID to load the live feed."); renderFallback(); return; } setStatus("Loading Instagram feed..."); try { const url = `https://graph.instagram.com/${INSTAGRAM_USER_ID}/media?fields=id,caption,media_type,media_url,permalink,thumbnail_url,timestamp&access_token=${INSTAGRAM_ACCESS_TOKEN}&limit=12`; const res = await fetch(url); if(!res.ok) throw new Error(`HTTP ${res.status}`); const json = await res.json(); const items = (json.data || []).filter(item => item.media_type === "IMAGE" || item.media_type === "CAROUSEL_ALBUM" || item.media_type === "VIDEO" ); if(!items.length){ setStatus("No Instagram posts available."); renderFallback(); return; } galleryGrid.innerHTML = ''; items.forEach(item => { const article = document.createElement('article'); article.className = 'gallery-item'; const caption = item.caption || ''; const thumb = item.media_type === "VIDEO" ? (item.thumbnail_url || item.media_url) : item.media_url; article.innerHTML = `${caption}
`; galleryGrid.appendChild(article); }); setStatus(""); } catch (err) { console.error("Instagram feed error:", err); setStatus("Could not load Instagram feed right now."); renderFallback(); } } document.addEventListener('DOMContentLoaded', loadInstagramFeed);