From d3db375654028db53a65b1f855ea15adf75015e2 Mon Sep 17 00:00:00 2001 From: akash Date: Wed, 11 Feb 2026 10:40:23 +0530 Subject: [PATCH] API: SerpAPI Error: Your account has run out of searches issue fixed --- pages/about.js | 19 +++++++++++++++++-- pages/api/reviews.js | 2 +- src/components/Home/TestimonialSection.js | 19 +++++++++++++++++-- 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/pages/about.js b/pages/about.js index c78b74b..4b78e3b 100644 --- a/pages/about.js +++ b/pages/about.js @@ -63,9 +63,24 @@ const About = () => { } function getProfileImage(r) { - const url = r.profile_photo_url || r.author_profile_photo_url || r.user?.thumbnail; + // Check multiple possible field names for profile images + const url = r.profile_photo_url || + r.author_profile_photo_url || + r.user?.thumbnail || + r.user?.profile_photo_url || + r.thumbnail || + r.profile_picture || + r.avatar; + if (!url) return null; - return url.startsWith("http") ? url : `https://lh3.googleusercontent.com/${url}`; + + // If it's already a full URL, return it + if (url.startsWith("http")) { + return url; + } + + // Otherwise, construct the Googleusercontent URL + return `https://lh3.googleusercontent.com/${url}`; } function getInitials(name) { diff --git a/pages/api/reviews.js b/pages/api/reviews.js index eddecef..6b97d9c 100644 --- a/pages/api/reviews.js +++ b/pages/api/reviews.js @@ -1,5 +1,5 @@ export default async function handler(req, res) { - const apiKey = "37eb7f83988cfd76ffb5c5af9adc25652efe5607e39997fc7d0e054d690ef25e"; + const apiKey = "8f20ae2ffd1700f38274ea87d2230ea8e0982834f8376bf311e7a4f5092662a8"; const placeId = "ChIJW9-CDf_X1IkRnBCKKZdqyvA"; // console.log("Pages API: Starting fetch for placeId:", placeId); diff --git a/src/components/Home/TestimonialSection.js b/src/components/Home/TestimonialSection.js index 5079dc1..957f054 100644 --- a/src/components/Home/TestimonialSection.js +++ b/src/components/Home/TestimonialSection.js @@ -131,9 +131,24 @@ const TestimonialSection = () => { } function getProfileImage(r) { - const url = r.profile_photo_url || r.author_profile_photo_url || r.user?.thumbnail; + // Check multiple possible field names for profile images + const url = r.profile_photo_url || + r.author_profile_photo_url || + r.user?.thumbnail || + r.user?.profile_photo_url || + r.thumbnail || + r.profile_picture || + r.avatar; + if (!url) return null; - return url.startsWith("http") ? url : `https://lh3.googleusercontent.com/${url}`; + + // If it's already a full URL, return it + if (url.startsWith("http")) { + return url; + } + + // Otherwise, construct the Googleusercontent URL + return `https://lh3.googleusercontent.com/${url}`; } function getInitials(name) {