query($sql); while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $postId = $row['post_id']; $text = strip_tags($row['text']); $time = date('Y-m-d', strtotime($row['time'])); // Video URL'sini metinden çıkar (ilk geçen .mp4'ü al) preg_match('/https?:\/\/[^\s"]+\.mp4/', $text, $matches); $videoUrl = $matches[0] ?? ''; // Thumbnail varsayalım (video adıyla aynı dizinde .jpg) $thumbnailUrl = str_replace('.mp4', '.jpg', $videoUrl); // Sayfa URL'si $pageUrl = "https://www.veezle.org/posts/" . $postId; // Video adı ve açıklama (örnek: ilk 80 karakter) $videoTitle = mb_substr($text, 0, 80); $videoDescription = mb_substr($text, 0, 160); // JSON-LD verisi echo "\n\n"; } ?>