diff --git a/bridges/ARDMediathekBridge.php b/bridges/ARDMediathekBridge.php new file mode 100644 index 00000000..5ac8a41d --- /dev/null +++ b/bridges/ARDMediathekBridge.php @@ -0,0 +1,36 @@ + array( + 'name' => 'Path', + 'required' => true, + 'title' => 'Enter without trailing slash', + 'defaultValue' => '45-min/Y3JpZDovL25kci5kZS8xMzkx' + ) + ) + ); + + public function collectData() { + date_default_timezone_set('Europe/Berlin'); + + $url = 'https://www.ardmediathek.de/sendung/' . $this->getInput('path') . '/'; + $html = getSimpleHTMLDOM($url); + $html = defaultLinkTo($html, $url); + + foreach($html->find('a.Root-sc-1ytw7qu-0') as $video) { + $item = array(); + $item['uri'] = $video->href; + $item['title'] = $video->find('h3', 0)->plaintext; + $item['content'] = ''; + $item['timestamp'] = strtotime(mb_substr($video->find('div.Line-epbftj-1', 0)->plaintext, 0, 10)); + + $this->items[] = $item; + } + } +}