From bb58aa8e31b813fd28abefb3cfca95caf1f9f689 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Sun, 11 Feb 2018 16:56:34 +0100 Subject: [PATCH] =?UTF-8?q?New=20bridge:=20T=C3=A9b=C3=A9o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bridges/TebeoBridge.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 bridges/TebeoBridge.php diff --git a/bridges/TebeoBridge.php b/bridges/TebeoBridge.php new file mode 100644 index 0000000..9bc3bff --- /dev/null +++ b/bridges/TebeoBridge.php @@ -0,0 +1,40 @@ + array( + 'name' => 'Catégorie', + 'type' => 'list', + 'values' => array( + 'Toutes les vidéos' => '/', + 'Actualité' => '/14-actualite', + 'Sport' => '/3-sport', + 'Culture-Loisirs' => '/5-culture-loisirs', + 'Société' => '/15-societe', + 'Langue Bretonne' => '/9-langue-bretonne' + ) + ) + )); + + public function collectData(){ + $url = self::URI . '/le-replay/' . $this->getInput('cat'); + + + $html = getSimpleHTMLDOM($url) + or returnServerError('Could not request Tébéo.'); + + foreach($html->find('div[id=items_replay] div.replay') as $element) { + $item = array(); + $item['uri'] = $element->find('a', 0)->href; + $item['title'] = $element->find('h3', 0)->plaintext; + $item['timestamp'] = strtotime($element->find('p.moment-format-day', 0)->plaintext); + $item['content'] = ''; + $this->items[] = $item; + } + } +}