\n"; //echo " "; echo "

"; echo "$note"; //echo " $fields"; echo "
"; //echo "$display_name\n"; echo "Following: $following_count\n"; echo "Followers: $followers_count\n"; echo "Posts: $statuses_count\n"; ?>



1, CURLOPT_URL => $apiUrl, CURLOPT_HTTPHEADER => $headers, ]); $response = curl_exec($curl); curl_close($curl); $data = json_decode($response, true); foreach ($data as $status) { $content = '
' . $status['content'] . '
'; $media = ''; $avatar = ''; $tootLink = ''; // Check for YouTube video link $youtubeRegex = '/https?:\/\/(www\.)?(m\.)?youtube\.com\/watch\?v=([a-zA-Z0-9_-]{11})/'; preg_match($youtubeRegex, $status['content'], $youtubeMatch); if ($youtubeMatch) { // Extract video ID from YouTube link $videoId = $youtubeMatch[3]; // Create embedded player for YouTube video $media = '
'; } else { // Check for image attachments if (count($status['media_attachments']) > 0) { $media = '
'; foreach ($status['media_attachments'] as $attachment) { if ($attachment['type'] === 'image') { $media .= '
'; } } $media .= '
'; } } // Check for spoiler tag if (strpos($status['url'], 'activity') !== false) { $avatar = '
'; $tootLink = ''; } else { $avatar = '
'; $tootLink = 'View on Mastodon'; } // Get the date of the status $date = new DateTime($status['created_at']); // Append content to feed echo $content . $media . $avatar . $tootLink . ' ' . $date->format('Y-m-d H:i:s') . '
'; } ?>