From c16747757d8a48dfbe29dd3de72e0224a19240d6 Mon Sep 17 00:00:00 2001 From: Mitsukarenai Date: Thu, 4 Jun 2015 17:06:14 +0200 Subject: [PATCH] (some cleanup) --- bridges/Dilbert.php | 43 -------------------------- bridges/Freenews.php | 2 +- bridges/Les400Culs.php | 2 +- bridges/LesJoiesDuCode.php | 55 ---------------------------------- bridges/Rue89Bridge.php | 1 + bridges/ThePirateBayBridge.php | 8 ++--- 6 files changed, 7 insertions(+), 104 deletions(-) delete mode 100644 bridges/Dilbert.php delete mode 100644 bridges/LesJoiesDuCode.php diff --git a/bridges/Dilbert.php b/bridges/Dilbert.php deleted file mode 100644 index cf741a3..0000000 --- a/bridges/Dilbert.php +++ /dev/null @@ -1,43 +0,0 @@ -returnError('Could not request Dilbert.', 404); - - foreach($html->find('div.STR_Image') as $element) { - $item = new Item(); - $href = $element->find('a',0)->href; - $item->uri = 'http://dilbert.com' . $href; - $content = str_replace('src="/', 'src="http://dilbert.com/',$element->innertext); - $content = str_replace('href="/', 'href="http://dilbert.com/',$content); - $item->content = $content; - $time = strtotime(substr($href, (strrpos($href, "/", -10) + 1), 10)); - $item->title = date("d/m/Y", $time); - $item->timestamp = $time; - $this->items[] = $item; - } - } - - public function getName(){ - return 'Dilbert'; - } - - public function getURI(){ - return 'http://dilbert.com'; - } - - public function getDescription(){ - return 'Dilbert via rss-bridge'; - } - - public function getCacheDuration(){ - return 14400; // 4 hours - } -} - diff --git a/bridges/Freenews.php b/bridges/Freenews.php index caaf769..65c0329 100644 --- a/bridges/Freenews.php +++ b/bridges/Freenews.php @@ -2,7 +2,7 @@ /** * * @name Freenews -* @description Un site d'actualité pour les freenautes (mais ne parlant pas que de la freebox). Ne rentrez pas d'id si vous voulez accéder aux actualités générales. +* @description Un site d'actualité pour les freenautes (mais ne parlant pas que de la freebox). Ne rentrez pas d'id si vous voulez accéder aux actualités générales. * @update 26/03/2014 * @use1(id="Id de la rubrique (sans le '-')") */ diff --git a/bridges/Les400Culs.php b/bridges/Les400Culs.php index e6dee73..f01e364 100644 --- a/bridges/Les400Culs.php +++ b/bridges/Les400Culs.php @@ -2,7 +2,7 @@ /** * * @name Les 400 Culs -* @description La planète sexe vue par Agnès Girard via rss-bridge +* @description La planète sexe vue par Agnès Girard via rss-bridge * @update 20/02/2014 */ require_once 'bridges/RssExpander.php'; diff --git a/bridges/LesJoiesDuCode.php b/bridges/LesJoiesDuCode.php deleted file mode 100644 index c5a74b8..0000000 --- a/bridges/LesJoiesDuCode.php +++ /dev/null @@ -1,55 +0,0 @@ -returnError('Could not request LesJoiesDuCode.', 404); - - foreach($html->find('div.post') as $element) { - $item = new Item(); - $temp = $element->find('h3 a', 0); - - $titre = $temp->innertext; - $url = $temp->href; - - $temp = $element->find('div.bodytype', 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 'Les Joies Du Code'; - } - - public function getURI(){ - return 'http://lesjoiesducode.fr/'; - } - - public function getCacheDuration(){ - return 7200; // 2h hours - } - public function getDescription(){ - return "Les Joies Du Code via rss-bridge"; - } -} diff --git a/bridges/Rue89Bridge.php b/bridges/Rue89Bridge.php index f1910c5..d357c3a 100644 --- a/bridges/Rue89Bridge.php +++ b/bridges/Rue89Bridge.php @@ -4,6 +4,7 @@ * Returns the 5 newest posts from http://rue89.nouvelobs.com/ (full text) * * @name Rue89 +* @homepage http://rue89.nouvelobs.com/ * @description Returns the 5 newest posts from Rue89 (full text) * @update 2015-01-30 * @maintainer pit-fgfjiudghdf diff --git a/bridges/ThePirateBayBridge.php b/bridges/ThePirateBayBridge.php index 3482dfc..12171ec 100644 --- a/bridges/ThePirateBayBridge.php +++ b/bridges/ThePirateBayBridge.php @@ -5,7 +5,7 @@ * 2014-05-25 * * @name The Pirate Bay -* @homepage https://thepiratebay.se/ +* @homepage https://thepiratebay.vg/ * @description Returns results for the keywords. You can put several list of keywords by separating them with a semicolon (e.g. "one show;another show") * @maintainer mitsukarenai * @update 2014-05-26 @@ -55,7 +55,7 @@ class ThePirateBayBridge extends BridgeAbstract{ $keywordsList = explode(";",$param['q']); foreach($keywordsList as $keywords){ - $html = file_get_html('https://thepiratebay.se/search/'.rawurlencode($keywords).'/0/3/0') or $this->returnError('Could not request TPB.', 404); + $html = file_get_html('https://thepiratebay.vg/search/'.rawurlencode($keywords).'/0/3/0') or $this->returnError('Could not request TPB.', 404); if ($html->find('table#searchResult', 0) == FALSE) $this->returnError('No result for query '.$keywords, 404); @@ -63,7 +63,7 @@ class ThePirateBayBridge extends BridgeAbstract{ foreach($html->find('tr') as $element) { $item = new \Item(); - $item->uri = 'https://thepiratebay.se/'.$element->find('a.detLink',0)->href; + $item->uri = 'https://thepiratebay.vg/'.$element->find('a.detLink',0)->href; $item->id = $item->uri; $item->timestamp = parseDateTimestamp($element); $item->title = $element->find('a.detLink',0)->plaintext; @@ -81,7 +81,7 @@ class ThePirateBayBridge extends BridgeAbstract{ } public function getURI(){ - return 'https://thepiratebay.se/'; + return 'https://thepiratebay.vg/'; } public function getCacheDuration(){