From 13232266778c61e52aab3b37ee7874bfa574f5d2 Mon Sep 17 00:00:00 2001 From: Nicolas Delsaux Date: Tue, 4 Feb 2014 17:54:18 +0100 Subject: [PATCH] ajout du script pour Sexactu --- bridges/Sexactu.php | 58 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 bridges/Sexactu.php diff --git a/bridges/Sexactu.php b/bridges/Sexactu.php new file mode 100644 index 0000000..5abb032 --- /dev/null +++ b/bridges/Sexactu.php @@ -0,0 +1,58 @@ +returnError('Could not request http://www.gqmagazine.fr/sexactu.', 404); + + foreach($html->find('div.content-holder ul li') as $element) { + $item = new Item(); + $temp = $element->find('h3 a', 0); + + $titreElement = $element->find('.title-holder .article-title a'); + $titre = $titreElement-> + $url = $temp->href; + + $temp = $element->find('div.text-container', 0); + $content = $temp->innertext; + + $auteur = $temp->find('.c1 em', 0); + $pos = strpos($auteur->innertext, "by"); + + 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); + + $this->items[] = $item; + } + } + + public function getName(){ + return 'Sexactu'; + } + + public function getURI(){ + return 'http://http://www.gqmagazine.fr/sexactu/'; + } + + public function getCacheDuration(){ + return 7200; // 2h hours + } + public function getDescription(){ + return "Sexactu via rss-bridge"; + } +} +?> +