diff --git a/app/[lang]/page.tsx b/app/[lang]/page.tsx index 637fad1..cd3db39 100644 --- a/app/[lang]/page.tsx +++ b/app/[lang]/page.tsx @@ -65,6 +65,33 @@ const testimonials = [ import { getDictionary, Locale } from "./dictionaries"; import prisma from "@/lib/prisma"; +async function getInstagramData() { + const url = 'https://instagram120.p.rapidapi.com/api/instagram/posts'; + const options = { + method: 'POST', + headers: { + 'x-rapidapi-key': process.env.RAPIDAPI_KEY || '', + 'x-rapidapi-host': 'instagram120.p.rapidapi.com', + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + username: 'kitebeachakyaka', + maxId: '' + }), + next: { revalidate: 86400 } + }; + + try { + const res = await fetch(url, options); + if (!res.ok) throw new Error('Instagram fetch failed'); + const data = await res.json(); + return data.result?.edges?.slice(0, 4).map((edge: any) => edge.node) || []; + } catch (err) { + console.error("Instagram fetch error:", err); + return []; + } +} + export default async function Home({ params }: { params: Promise<{ lang: string }> }) { const { lang } = await params; const dict = await getDictionary(lang as Locale); @@ -106,6 +133,7 @@ export default async function Home({ params }: { params: Promise<{ lang: string }; const displayFeatures = dbFeatures.length > 0 ? dbFeatures : defaultFeatures; + const instagramPosts = await getInstagramData(); return (
+ {post.caption?.text} +
+