From dbe9ae44dfdf307b44c65b554c98c5f40774ff77 Mon Sep 17 00:00:00 2001 From: Nicolas Delsaux Date: Wed, 5 Feb 2014 10:16:45 +0100 Subject: [PATCH] Correctiond e quelques boulettes, mais ca ne marche toujours pas --- bridges/Sexactu.php | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/bridges/Sexactu.php b/bridges/Sexactu.php index 37b16c18..9153afc7 100644 --- a/bridges/Sexactu.php +++ b/bridges/Sexactu.php @@ -5,7 +5,7 @@ * @description Sexactu via rss-bridge * @update 04/02/2014 */ -class LesJoiesDuCodeBridge extends BridgeAbstract{ +class SexactuBridge extends BridgeAbstract{ public function collectData(array $param){ $html = file_get_html('http://http://www.gqmagazine.fr/sexactu') or $this->returnError('Could not request http://www.gqmagazine.fr/sexactu.', 404); @@ -13,27 +13,14 @@ class LesJoiesDuCodeBridge extends BridgeAbstract{ foreach($html->find('div.content-holder ul li') as $element) { $item = new Item(); - $titreElement = $element->find('.title-holder .article-title a'); - $titre = $titreElement->innertext - $url = $titreElement->href; - - $temp = $element->find('div.text-container', 0); - $content = $temp->innertext; - - $auteur = $element->find('div.header-holder', 0); - $pos = strpos($auteur->innertext, "par"); - - if($pos > 0) - { - $auteur = trim(str_replace("*/", "", substr($auteur->innertext, ($pos + 2)))); - $item->name = $auteur; - } - - - $item->content .= trim($content); - $item->uri = $url; - $item->title = trim($titre); + // various metadata + $titleBock = $element->find('title-holder'); + $titleData = $titleBlock->find('article-title h2 a'); + $item->title = trim($titleData->innertext); + $item->uri = $titleData->href; + $item->name = "Maïa Mazaurette"; + $item->content = $element->find('text-container')->innertext; $this->items[] = $item; } }