[ 'lang' => [ 'name' => 'Language', 'type' => 'list', 'values' => [ 'English' => 'en', 'Spanish' => 'es', 'German' => 'de', 'French' => 'fr', 'Italian' => 'it', 'Chinese' => 'zh', ], 'defaultValue' => 'en' ], 'platform' => [ 'name' => 'Platform', 'type' => 'list', 'values' => [ 'Windows' => 'win', 'Mac' => 'mac' ], 'defaultValue' => 'win' ] ] ]; public function collectData() { $lang = $this->getInput('lang'); $platform = $this->getInput('platform'); $url = 'https://y2matedownloader.com/' . $lang . '/y2mate-downloader-changelog'; // Füge "-mac" zur URL hinzu, wenn die Mac-Plattform ausgewählt wurde if ($platform === 'mac') { $url .= '-mac'; } $html = getSimpleHTMLDOM($url) or returnServerError('Could not request webpage: ' . $url); // Extract change log items foreach($html->find('div.change-log-items') as $section) { $title_element = $section->find('p.product-name', 0); $date_element = $section->find('p.version-date', 0); $desc_element = $section->find('div.desc', 0); if ($title_element && $date_element && $desc_element) { $item = []; $item['title'] = $title_element->plaintext; $item['timestamp'] = strtotime($date_element->plaintext); $item['uri'] = $url; $item['uid'] = $item['title'] . '-' . $item['timestamp']; // Extract content from "New" and "Fix" sections $content = ''; $new_section = $desc_element->find('div.list-l', 0); $fix_section = $desc_element->find('div.list-r', 0); if ($new_section) { $new_title = $new_section->find('p.new-title', 0); if ($new_title) { $content .= '