array( 'name' => 'Show Link or ID', 'required' => true, 'title' => 'Link to the show page or just its alphanumeric suffix', 'defaultValue' => 'https://www.ardmediathek.de/sendung/45-min/Y3JpZDovL25kci5kZS8xMzkx/' ) ) ); public function collectData() { date_default_timezone_set('Europe/Berlin'); $pathComponents = explode('/', $this->getInput('path')); if (empty($pathComponents)) { returnClientError('Path may not be empty'); } if (count($pathComponents) < 2) { $showID = $pathComponents[0]; } else { $lastKey = count($pathComponents) - 1; $showID = $pathComponents[$lastKey]; if (strlen($showID) === 0) { $showID = $pathComponents[$lastKey - 1]; } } $url = SELF::APIENDPOINT . $showID . '/?pageSize=' . SELF::PAGESIZE; $rawJSON = getContents($url); $processedJSON = json_decode($rawJSON); foreach($processedJSON->teasers as $video) { $item = array(); // there is also ->links->self->id, ->links->self->urlId, ->links->target->id, ->links->target->urlId $item['uri'] = SELF::VIDEOLINKPREFIX . $video->id . '/'; // there is also ->mediumTitle and ->shortTitle $item['title'] = $video->longTitle; // in the test, aspect16x9 was the only child of images, not sure whether that is always true $item['enclosures'] = array( str_replace(SELF::IMAGEWIDTHPLACEHOLDER, SELF::IMAGEWIDTH, $video->images->aspect16x9->src) ); $item['content'] = '
'; $item['timestamp'] = $video->broadcastedOn; $item['uid'] = $video->id; $item['author'] = $video->publicationService->name; $this->items[] = $item; } } }