find('div.component-block h3.component-header'); foreach ($versionBlocks as $versionHeader) { // Get version number from header $versionText = trim($versionHeader->find('div.text', 0)->plaintext ?? ''); if (empty($versionText)) continue; // Skip branch names - only process actual version numbers (e.g., Version 0.1.0, Version 1.2.3) if (!preg_match('/^Version\s+\d+\./', $versionText)) continue; // Remove "Version " prefix to get clean version number $versionNumber = preg_replace('/^Version\s+/', '', $versionText); // Get the parent block containing all version information $versionBlock = $versionHeader->parent(); if (!$versionBlock) continue; $item = []; $item['title'] = 'Futurama: Hit & Run - Version ' . $versionNumber; $item['uid'] = 'futurama-har-' . $versionNumber; // Find version ID from badges $badges = $versionBlock->find('div.component-badge'); foreach ($badges as $badge) { $badgeText = $badge->plaintext; if (strpos($badgeText, 'ID ') !== false) { preg_match('/ID (\d+)/', $badgeText, $matches); if (isset($matches[1])) { $item['uid'] = 'futurama-har-id-' . $matches[1]; } } // Get published date if (strpos($badgeText, 'Published') !== false) { $timeElement = $badge->find('time.component-human-time', 0); if ($timeElement && $timeElement->datetime) { $item['timestamp'] = strtotime($timeElement->datetime); } } } // Use the project downloads page as article link $item['uri'] = self::URI; // Find download link for content $downloadLink = null; $downloadBtn = $versionBlock->find('a.component-button', 0); if ($downloadBtn && $downloadBtn->href) { $downloadLink = 'https://modbakery.donutteam.com' . $downloadBtn->href; } // Build content $content = ''; // Add banner $content .= '
'; $content .= 'Futurama: Hit & Run Banner'; $content .= '

'; // Add changelog if available $changelogDetails = $versionBlock->find('details.component-details', 0); if ($changelogDetails) { // Get the entire changelog content (includes h2, h3, ul, p elements) $changelogHTML = $changelogDetails->innertext; // Remove the tag from the output $changelogHTML = preg_replace('/.*?<\/summary>/is', '', $changelogHTML); // Remove redundant version header from changelog (e.g.,

Version 0.1.2

) $changelogHTML = preg_replace('/]*>Version\s+' . preg_quote($versionNumber, '/') . '<\/h2>/is', '', $changelogHTML); if (!empty(trim(strip_tags($changelogHTML)))) { $content .= $changelogHTML; } } $item['content'] = $content; $item['author'] = 'Slurm Team'; // Add banner as enclosure $item['enclosures'][] = 'https://nyc3.digitaloceanspaces.com/donut-team/files/2025/10/18/19-46-32/399a6671-8cf9-4aa0-b3d5-6cd8656f8a09/banner.webp'; $this->items[] = $item; } } public function getName() { return 'Futurama: Hit & Run - Mod Releases'; } }