From 71317ece8924fbb9b70e2c5f2f79c9cece5ebbf3 Mon Sep 17 00:00:00 2001 From: pit-fgfjiudghdf Date: Mon, 10 Mar 2014 19:20:29 +0100 Subject: [PATCH] Create BouffonduroiBridge.php C'est mon premier bridge --- bridges/BouffonduroiBridge.php | 53 ++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 bridges/BouffonduroiBridge.php diff --git a/bridges/BouffonduroiBridge.php b/bridges/BouffonduroiBridge.php new file mode 100644 index 00000000..460d610f --- /dev/null +++ b/bridges/BouffonduroiBridge.php @@ -0,0 +1,53 @@ +returnError('Could not request Bouffonduroi.', 404); + $data = $html->find('div.article[itemscope=*]'); + $Cnt = 0; + foreach( $data as $element) { + + $item = new \Item(); + $item->uri = $element->find('a', 0)->href; + $item->title = 'Bouffonduroi - '.$element->find('a', 0)->plaintext; + $item->content = $element->find('a', 0)->innertext; + $img = $element->find('img', 0); + if (isset($img)) + { + $item->content .= '
'.$img; + } + $video = $element->find('div.contenuArticle iframe', 0)->src; + if (isset($video)) + { + $item->content .= '
Video !! '; + } + foreach($element->find('div.contenuArticle span') as $contentarticle) { + $item->content .= '
'.$contentarticle->plaintext; + } + $this->items[] = $item; + } + } + + public function getName(){ + return 'Bouffonduroi'; + } + + public function getURI(){ + return 'http://Bouffonduroi.over-blog.fr/'; + + } + + public function getCacheDuration(){ + return 21600; // 6 hours + } +}