// --- B. JALUR AUTO-SCRAPE REAL-TIME VIA SERPER.DEV (TANPA DATABASE) --- // Masukkan semua keyword target Anda di dalam array di bawah ini (Gunakan format URL / pakai tanda hubung) elseif (in_array($slug, [ 'scott-mcnealy-net-worth' ])) { // 1. DAFTAR API KEYS SERPER ANDA (Otomatis Load Balancing / Diacak agar awet) $serper_keys = [ "b8f5c584188a6031d0a3022f2181ee7ae39ebbd3", "6524dee99f8ad23a6159f8d0cf1e1fd4ad3d893d", "4c7550399a408f3a53ddaf9896a753bed62a8934", "c624a132228a0663799adf6572edb11f835ca1fb", "532034e8762b815d137cae719e45ad9b362eae1b" ]; shuffle($serper_keys); // Acak urutan API Key setiap ada request masuk // Convert slug kembali menjadi keyword bersih untuk dicari di Google $keyword = str_replace('-', ' ', $slug); $kw_cap = ucwords($keyword); $snippets = []; $images = []; $success = false; // 2. PROSES SCRAPING TEXT & IMAGES VIA REAL-TIME CURL foreach ($serper_keys as $api_key) { // A. Tarik Data Organik (Teks/Snippets) $ch_text = curl_init(); curl_setopt($ch_text, CURLOPT_URL, "https://google.serper.dev/search"); curl_setopt($ch_text, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch_text, CURLOPT_POST, true); curl_setopt($ch_text, CURLOPT_HTTPHEADER, [ "X-API-KEY: $api_key", "Content-Type: application/json" ]); curl_setopt($ch_text, CURLOPT_POSTFIELDS, json_encode([ "q" => $keyword, "gl" => "us", // Target pasar United States "hl" => "en", "num" => 8 ])); curl_setopt($ch_text, CURLOPT_TIMEOUT, 6); $res_text = curl_exec($ch_text); $http_code = curl_getinfo($ch_text, CURLINFO_HTTP_CODE); curl_close($ch_text); if ($http_code == 200) { $data_text = json_decode($res_text, true); if (isset($data_text['organic'])) { foreach ($data_text['organic'] as $org) { if (isset($org['snippet']) && strlen($org['snippet']) > 50) { $snippets[] = $org['snippet']; } } } // B. Tarik Data Gambar (Hanya jika teks berhasil didapatkan) $ch_img = curl_init(); curl_setopt($ch_img, CURLOPT_URL, "https://google.serper.dev/images"); curl_setopt($ch_img, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch_img, CURLOPT_POST, true); curl_setopt($ch_img, CURLOPT_HTTPHEADER, [ "X-API-KEY: $api_key", "Content-Type: application/json" ]); curl_setopt($ch_img, CURLOPT_POSTFIELDS, json_encode([ "q" => $keyword, "gl" => "us", "num" => 4 ])); curl_setopt($ch_img, CURLOPT_TIMEOUT, 6); $res_img = curl_exec($ch_img); curl_close($ch_img); $data_img = json_decode($res_img, true); if (isset($data_img['images'])) { foreach (array_slice($data_img['images'], 0, 4) as $img) { if (isset($img['imageUrl'])) { $images[] = $img['imageUrl']; } } } $success = true; break; // Berhenti looping jika API key ini sudah sukses merespon } } // 3. GENERATOR KONTEN LONG-FORM BERDASARKAN HASIL GOOGLE SCRAPE if ($success && !empty($snippets)) { $intro_txt = isset($snippets[0]) ? $snippets[0] : "Exploring the latest updates and details regarding $kw_cap."; $mid_txt = isset($snippets[1]) ? $snippets[1] : "Many sources point out significant market shifts concerning $keyword this season."; $extra_txt = isset($snippets[2]) ? $snippets[2] : "Recent public records provide deeper insights into $keyword operations."; // Bangun paragraf tambahan dari sisa snippet Google agar artikelnya PANJANG $extended_content = ""; if (count($snippets) > 3) { $extended_content .= "

Additional Insights & Public Overview

"; for ($i = 3; $i < count($snippets); $i++) { $extended_content .= "

" . $snippets[$i] . "

"; } } // Bangun Galeri Gambar Grid HTML $img_html = '
'; foreach ($images as $img_url) { $img_html .= '
'.$kw_cap.'
'; } $img_html .= '
'; // Racikan Artikel PSEO Long-Form Final $virtual_content = "

Welcome to our comprehensive 2026 data review on {$kw_cap}. In this dynamic report, we aggregate structural patterns, real-time public indexing data, and authoritative trends circulating inside the United States digital ecosystem. {$intro_txt}

Why {$kw_cap} is Trending in 2026

{$mid_txt}

Industry analysts monitors that search parameters for {$keyword} has shifted dramatically due to increased user engagements and institutional queries. This indicates a high-velocity momentum that remains relevant for global financial and cultural niches.

Visual Gallery & Core References

Curated graphic data matched directly via live search node distributions:

{$img_html}

Comprehensive Analysis & Technical Overview

{$extra_txt}

To establish verified benchmarks, our automatic network crawlers match these snippets against cross-border platform parameters. This guarantees that modern queries regarding this topic receive optimal structural representation.

{$extended_content}

Disclaimer: The structural texts displayed above are compiled in real-time under fair-use parameters for search signal synchronization tracking networks.

"; $data = [ 'id' => crc32($slug), 'title' => $kw_cap, 'content' => $virtual_content, 'image_main' => isset($images[0]) ? $images[0] : '', // Gambar pertama jadi gambar utama 'last_updated' => date('Y-m-d H:i:s') ]; $view = 'themes/view.php'; $meta_title = $kw_cap . " - Ideas, Trends & Pictures (2026 Guide)"; $meta_desc = substr(strip_tags($intro_txt), 0, 150) . "... Get full real-time updates for " . $kw_cap; } else { // Fallback jika API down atau Kuota Habis semuanya $data = [ 'id' => crc32($slug), 'title' => $kw_cap, 'content' => "

Analysis report for {$kw_cap} is currently undergoing automated validation. Search statistics and network signals project an upward momentum for this entity in 2026.

", 'image_main' => '', 'last_updated' => date('Y-m-d H:i:s') ]; $view = 'themes/view.php'; $meta_title = $kw_cap . " - Profile Data"; $meta_desc = "Discover real-time analytics data for " . $kw_cap; } }