From 1d53b70272cffa11426a4b00ee5cc1643afcf222 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sat, 6 Aug 2016 16:00:56 +0200 Subject: [PATCH] bridges: Remove unused functions and update scopes Many bridges implemented getDescription() which is only applicable for bridges extending RSSExpander. Functions that are not part of the abstract class or interface should be in private scope for better readability. --- bridges/AllocineFRBridge.php | 5 +---- bridges/AllocineT5Bridge.php | 5 +---- bridges/AllocineTueursEnSerieBridge.php | 5 +---- bridges/BlaguesDeMerdeBridge.php | 5 +---- bridges/CADBridge.php | 4 ++-- bridges/CastorusBridge.php | 10 +++++----- bridges/CommonDreamsBridge.php | 4 ++-- bridges/CopieDoubleBridge.php | 8 +------- bridges/DauphineLibereBridge.php | 4 ++-- bridges/DeveloppezDotComBridge.php | 8 ++++---- bridges/DilbertBridge.php | 8 ++------ bridges/ElsevierBridge.php | 8 ++++---- bridges/EstCeQuonMetEnProdBridge.php | 8 ++------ bridges/FootitoBridge.php | 6 +----- bridges/GBAtempBridge.php | 12 ++++++------ bridges/GiphyBridge.php | 6 +----- bridges/GuruMedBridge.php | 4 ++-- bridges/HentaiHavenBridge.php | 5 +---- bridges/KoreusBridge.php | 6 +++--- bridges/LeJournalDuGeekBridge.php | 6 +++--- bridges/LesJoiesDuCodeBridge.php | 6 +----- bridges/MsnMondeBridge.php | 4 ++-- bridges/NextInpactBridge.php | 6 +++--- bridges/NiceMatinBridge.php | 4 ++-- bridges/NovelUpdatesBridge.php | 5 +---- bridges/PlanetLibreBridge.php | 4 ++-- bridges/ReporterreBridge.php | 4 ++-- bridges/SensCritiqueBridge.php | 16 ++++++++-------- bridges/Sexactu.php | 7 ++----- bridges/ShanaprojectBridge.php | 20 ++++++++++---------- bridges/TheCodingLoveBridge.php | 6 +----- bridges/TwitterBridgeTweaked.php | 6 +----- bridges/WordPressBridge.php | 10 +++++----- bridges/WorldOfTanks.php | 7 ++----- 34 files changed, 87 insertions(+), 145 deletions(-) diff --git a/bridges/AllocineFRBridge.php b/bridges/AllocineFRBridge.php index 7270b97..c54edff 100644 --- a/bridges/AllocineFRBridge.php +++ b/bridges/AllocineFRBridge.php @@ -10,7 +10,7 @@ class AllocineFRBridge extends BridgeAbstract{ $this->name = "Allo Cine : Faux Raccord"; $this->uri = "http://www.allocine.fr/video/programme-12284/saison-24580/"; $this->description = "Allo Cine : Faux Raccord"; - $this->update = "07/11/2013"; + $this->update = "2016-08-06"; } @@ -50,8 +50,5 @@ class AllocineFRBridge extends BridgeAbstract{ public function getCacheDuration(){ return 25200; // 7 hours } - public function getDescription(){ - return "Allo Cine : " . $this->_NOM . " via rss-bridge"; - } } ?> diff --git a/bridges/AllocineT5Bridge.php b/bridges/AllocineT5Bridge.php index 4c13cdf..2dd1d81 100644 --- a/bridges/AllocineT5Bridge.php +++ b/bridges/AllocineT5Bridge.php @@ -10,7 +10,7 @@ class AllocineT5Bridge extends BridgeAbstract{ $this->name = "Allo Cine : Top 5"; $this->uri = "http://www.allocine.fr/video/programme-12299/saison-22542/"; $this->description = "Allo Cine : Top 5 via rss-bridge"; - $this->update = "07/11/2013"; + $this->update = "2016-08-06"; } @@ -50,8 +50,5 @@ class AllocineT5Bridge extends BridgeAbstract{ public function getCacheDuration(){ return 25200; // 7 hours } - public function getDescription(){ - return "Allo Cine : " . $this->_NOM . " via rss-bridge"; - } } ?> diff --git a/bridges/AllocineTueursEnSerieBridge.php b/bridges/AllocineTueursEnSerieBridge.php index 6a27e61..d4330ec 100644 --- a/bridges/AllocineTueursEnSerieBridge.php +++ b/bridges/AllocineTueursEnSerieBridge.php @@ -10,7 +10,7 @@ class AllocineTueursEnSerieBridge extends BridgeAbstract{ $this->name = "Allo Cine : Tueurs En Serie"; $this->uri = "http://www.allocine.fr/video/programme-12286/saison-22938/"; $this->description = "Allo Cine : Tueurs En Serie"; - $this->update = "12/11/2013"; + $this->update = "2016-08-06"; } @@ -50,8 +50,5 @@ class AllocineTueursEnSerieBridge extends BridgeAbstract{ public function getCacheDuration(){ return 25200; // 7 hours } - public function getDescription(){ - return "Allo Cine : " . $this->_NOM . " via rss-bridge"; - } } ?> diff --git a/bridges/BlaguesDeMerdeBridge.php b/bridges/BlaguesDeMerdeBridge.php index ca87242..126ca82 100644 --- a/bridges/BlaguesDeMerdeBridge.php +++ b/bridges/BlaguesDeMerdeBridge.php @@ -7,7 +7,7 @@ class BlaguesDeMerdeBridge extends BridgeAbstract{ $this->name = "Blagues De Merde"; $this->uri = "http://www.blaguesdemerde.fr/"; $this->description = "Blagues De Merde"; - $this->update = "16/10/2013"; + $this->update = "2016-08-06"; } @@ -43,8 +43,5 @@ class BlaguesDeMerdeBridge extends BridgeAbstract{ public function getCacheDuration(){ return 7200; // 2h hours } - public function getDescription(){ - return "Blagues De Merde via rss-bridge"; - } } ?> diff --git a/bridges/CADBridge.php b/bridges/CADBridge.php index 90b338c..299bd10 100644 --- a/bridges/CADBridge.php +++ b/bridges/CADBridge.php @@ -5,10 +5,10 @@ class CADBridge extends BridgeAbstract{ $this->name = "CAD Bridge"; $this->uri = "http://www.cad-comic.com/"; $this->description = "Returns the newest articles."; - $this->update = "2016-08-02"; + $this->update = "2016-08-06"; } - function CADExtractContent($url) { + private function CADExtractContent($url) { $html3 = $this->file_get_html($url); // The request might fail due to missing https support or wrong URL diff --git a/bridges/CastorusBridge.php b/bridges/CastorusBridge.php index 55ff7b7..a6ac5f4 100644 --- a/bridges/CastorusBridge.php +++ b/bridges/CastorusBridge.php @@ -5,7 +5,7 @@ class CastorusBridge extends BridgeAbstract { $this->name = "Castorus Bridge"; $this->uri = $this->getURI(); $this->description = "Returns the latest changes"; - $this->update = "2016-08-05"; + $this->update = "2016-08-06"; $this->parameters["Get latest changes"] = '[]'; $this->parameters["Get latest changes via ZIP code"] = @@ -33,7 +33,7 @@ class CastorusBridge extends BridgeAbstract { } // Extracts the tile from an actitiy - function ExtractActivityTitle($activity){ + private function ExtractActivityTitle($activity){ $title = $activity->find('a', 0); if(!$title) @@ -43,7 +43,7 @@ class CastorusBridge extends BridgeAbstract { } // Extracts the url from an actitiy - function ExtractActivityUrl($activity){ + private function ExtractActivityUrl($activity){ $url = $activity->find('a', 0); if(!$url) @@ -53,7 +53,7 @@ class CastorusBridge extends BridgeAbstract { } // Extracts the time from an activity - function ExtractActivityTime($activity){ + private function ExtractActivityTime($activity){ // Unfortunately the time is part of the parent node, // so we have to clear all child nodes first $nodes = $activity->find('*'); @@ -69,7 +69,7 @@ class CastorusBridge extends BridgeAbstract { } // Extracts the price change - function ExtractActivityPrice($activity){ + private function ExtractActivityPrice($activity){ $price = $activity->find('span', 1); if(!$price) diff --git a/bridges/CommonDreamsBridge.php b/bridges/CommonDreamsBridge.php index cf4b589..6222661 100644 --- a/bridges/CommonDreamsBridge.php +++ b/bridges/CommonDreamsBridge.php @@ -6,10 +6,10 @@ class CommonDreamsBridge extends BridgeAbstract{ $this->name = "CommonDreams Bridge"; $this->uri = "http://www.commondreams.org/"; $this->description = "Returns the newest articles."; - $this->update = "2016-08-02"; + $this->update = "2016-08-06"; } - function CommonDreamsExtractContent($url) { + private function CommonDreamsExtractContent($url) { $html3 = $this->file_get_html($url); $text = $html3->find('div[class=field--type-text-with-summary]', 0)->innertext; $html3->clear(); diff --git a/bridges/CopieDoubleBridge.php b/bridges/CopieDoubleBridge.php index 2030979..d629976 100644 --- a/bridges/CopieDoubleBridge.php +++ b/bridges/CopieDoubleBridge.php @@ -7,7 +7,7 @@ class CopieDoubleBridge extends BridgeAbstract{ $this->name = "CopieDouble"; $this->uri = "http://www.copie-double.com/"; $this->description = "CopieDouble"; - $this->update = "12/12/2013"; + $this->update = "2016-08-06"; } @@ -50,13 +50,7 @@ class CopieDoubleBridge extends BridgeAbstract{ return 'http://www.copie-double.com'; } - public function getDescription(){ - return 'CopieDouble via rss-bridge'; - } - public function getCacheDuration(){ return 14400; // 4 hours } } - -?> diff --git a/bridges/DauphineLibereBridge.php b/bridges/DauphineLibereBridge.php index d2fd1d1..24477a7 100644 --- a/bridges/DauphineLibereBridge.php +++ b/bridges/DauphineLibereBridge.php @@ -7,7 +7,7 @@ class DauphineLibereBridge extends BridgeAbstract { $this->name = "DauphineLibereBridge Bridge"; $this->uri = "http://www.ledauphine.com/"; $this->description = "Returns the newest articles."; - $this->update = "2016-08-02"; + $this->update = "2016-08-06"; $this->parameters[] = '[ @@ -81,7 +81,7 @@ class DauphineLibereBridge extends BridgeAbstract { ]'; } - function ExtractContent($url, $context) { + private function ExtractContent($url, $context) { $html2 = $this->file_get_html($url, false, $context); $text = $html2->find('div.column', 0)->innertext; $text = preg_replace('@]*?>.*?@si', '', $text); diff --git a/bridges/DeveloppezDotComBridge.php b/bridges/DeveloppezDotComBridge.php index 51dc013..66a9b2b 100644 --- a/bridges/DeveloppezDotComBridge.php +++ b/bridges/DeveloppezDotComBridge.php @@ -6,10 +6,10 @@ class DeveloppezDotComBridge extends BridgeAbstract{ $this->name = "Developpez.com Actus (FR)"; $this->uri = "http://www.developpez.com/"; $this->description = "Returns the 15 newest posts from DeveloppezDotCom (full text)."; - $this->update = "2016-08-03"; + $this->update = "2016-08-06"; } - function DeveloppezDotComStripCDATA($string) { + private function DeveloppezDotComStripCDATA($string) { $string = str_replace('', '', $string); return $string; @@ -17,7 +17,7 @@ class DeveloppezDotComBridge extends BridgeAbstract{ // F***ing quotes from Microsoft Word badly encoded, here was the trick: // http://stackoverflow.com/questions/1262038/how-to-replace-microsoft-encoded-quotes-in-php - function convert_smart_quotes($string) + private function convert_smart_quotes($string) { $search = array(chr(145), chr(146), @@ -34,7 +34,7 @@ class DeveloppezDotComBridge extends BridgeAbstract{ return str_replace($search, $replace, $string); } - function DeveloppezDotComExtractContent($url) { + private function DeveloppezDotComExtractContent($url) { $articleHTMLContent = $this->file_get_html($url); $text = $this->convert_smart_quotes($articleHTMLContent->find('div.content', 0)->innertext); $text = utf8_encode($text); diff --git a/bridges/DilbertBridge.php b/bridges/DilbertBridge.php index 3826028..f513ef9 100644 --- a/bridges/DilbertBridge.php +++ b/bridges/DilbertBridge.php @@ -6,8 +6,8 @@ class DilbertBridge extends BridgeAbstract { $this->maintainer = 'kranack'; $this->name = $this->getName(); $this->uri = $this->getURI(); - $this->description = $this->getDescription(); - $this->update = "14/05/2016"; + $this->description = 'The Unofficial Dilbert Daily Comic Strip'; + $this->update = "2016-08-06"; } @@ -46,10 +46,6 @@ class DilbertBridge extends BridgeAbstract { return 'http://dilbert.com'; } - public function getDescription() { - return 'The Unofficial Dilbert Daily Comic Strip'; - } - public function getCacheDuration() { return 21600; // 6 hours } diff --git a/bridges/ElsevierBridge.php b/bridges/ElsevierBridge.php index 4f4cd57..bd35925 100644 --- a/bridges/ElsevierBridge.php +++ b/bridges/ElsevierBridge.php @@ -6,7 +6,7 @@ class ElsevierBridge extends BridgeAbstract{ $this->name = 'Elsevier journals recent articles'; $this->uri = 'http://www.journals.elsevier.com'; $this->description = 'Returns the recent articles published in Elsevier journals'; - $this->update = '2016-08-02'; + $this->update = '2016-08-06'; $this->parameters[] = '[ @@ -21,7 +21,7 @@ class ElsevierBridge extends BridgeAbstract{ } // Extracts the list of names from an article as string - function ExtractArticleName ($article){ + private function ExtractArticleName ($article){ $names = $article->find('small', 0); if($names) return trim($names->plaintext); @@ -29,7 +29,7 @@ class ElsevierBridge extends BridgeAbstract{ } // Extracts the timestamp from an article - function ExtractArticleTimestamp ($article){ + private function ExtractArticleTimestamp ($article){ $time = $article->find('.article-info', 0); if($time){ $timestring = trim($time->plaintext); @@ -53,7 +53,7 @@ class ElsevierBridge extends BridgeAbstract{ } // Extracts the content from an article - function ExtractArticleContent ($article){ + private function ExtractArticleContent ($article){ $content = $article->find('.article-content', 0); if($content){ return trim($content->plaintext); diff --git a/bridges/EstCeQuonMetEnProdBridge.php b/bridges/EstCeQuonMetEnProdBridge.php index 7d3e652..b964ea4 100644 --- a/bridges/EstCeQuonMetEnProdBridge.php +++ b/bridges/EstCeQuonMetEnProdBridge.php @@ -5,8 +5,8 @@ class EstCeQuonMetEnProdBridge extends BridgeAbstract { $this->maintainer = 'ORelio'; $this->name = $this->getName(); $this->uri = $this->getURI(); - $this->description = $this->getDescription(); - $this->update = "02/07/2016"; + $this->description = 'Should we put a website in production today? (French)'; + $this->update = "2016-08-06"; } public function collectData(array $param) { @@ -45,10 +45,6 @@ class EstCeQuonMetEnProdBridge extends BridgeAbstract { return 'https://www.estcequonmetenprodaujourdhui.info/'; } - public function getDescription() { - return 'Should we put a website in production today? (French)'; - } - public function getCacheDuration() { return 21600; // 6 hours } diff --git a/bridges/FootitoBridge.php b/bridges/FootitoBridge.php index bc16d43..cfd1496 100644 --- a/bridges/FootitoBridge.php +++ b/bridges/FootitoBridge.php @@ -7,7 +7,7 @@ class FootitoBridge extends BridgeAbstract{ $this->name = "Footito"; $this->uri = "http://www.footito.fr/"; $this->description = "Footito"; - $this->update = "21/11/2013"; + $this->update = "2016-08-06"; } @@ -53,8 +53,4 @@ class FootitoBridge extends BridgeAbstract{ public function getCacheDuration(){ return 3600; // 1h hours } - public function getDescription(){ - return "Footito via rss-bridge"; - } } -?> diff --git a/bridges/GBAtempBridge.php b/bridges/GBAtempBridge.php index 69c5d09..75217b0 100644 --- a/bridges/GBAtempBridge.php +++ b/bridges/GBAtempBridge.php @@ -9,7 +9,7 @@ class GBAtempBridge extends BridgeAbstract { $this->name = 'GBAtemp'; $this->uri = $this->getURI(); $this->description = 'GBAtemp is a user friendly underground video game community.'; - $this->update = '2016-08-02'; + $this->update = '2016-08-06'; $this->parameters[] = '[ @@ -40,7 +40,7 @@ class GBAtempBridge extends BridgeAbstract { ]'; } - function ExtractFromDelimiters($string, $start, $end) { + private function ExtractFromDelimiters($string, $start, $end) { if (strpos($string, $start) !== false) { $section_retrieved = substr($string, strpos($string, $start) + strlen($start)); $section_retrieved = substr($section_retrieved, 0, strpos($section_retrieved, $end)); @@ -48,7 +48,7 @@ class GBAtempBridge extends BridgeAbstract { } return false; } - function StripWithDelimiters($string, $start, $end) { + private function StripWithDelimiters($string, $start, $end) { while (strpos($string, $start) !== false) { $section_to_remove = substr($string, strpos($string, $start)); $section_to_remove = substr($section_to_remove, 0, strpos($section_to_remove, $end) + strlen($end)); @@ -56,7 +56,7 @@ class GBAtempBridge extends BridgeAbstract { } return $string; } - function build_item($uri, $title, $author, $timestamp, $thumnail, $content) { + private function build_item($uri, $title, $author, $timestamp, $thumnail, $content) { $item = new \Item(); $item->uri = $uri; $item->title = $title; @@ -67,14 +67,14 @@ class GBAtempBridge extends BridgeAbstract { return $item; } - function cleanup_post_content($content, $site_url) { + private function cleanup_post_content($content, $site_url) { $content = str_replace(':arrow:', '➤', $content); $content = str_replace('href="attachments/', 'href="'.$site_url.'attachments/', $content); $content = $this->StripWithDelimiters($content, ''); return $content; } - function fetch_post_content($uri, $site_url) { + private function fetch_post_content($uri, $site_url) { $html = $this->file_get_html($uri) or $this->returnError('Could not request GBAtemp: '.$uri, 500); $content = $html->find('div.messageContent', 0)->innertext; return $this->cleanup_post_content($content, $site_url); diff --git a/bridges/GiphyBridge.php b/bridges/GiphyBridge.php index 8f29bad..acc01d2 100644 --- a/bridges/GiphyBridge.php +++ b/bridges/GiphyBridge.php @@ -9,7 +9,7 @@ class GiphyBridge extends BridgeAbstract{ $this->name = "Giphy Bridge"; $this->uri = "http://giphy.com/"; $this->description = "Bridge for giphy.com"; - $this->update = "2014-12-05"; + $this->update = "2016-08-06"; $this->parameters["By tag"] = '[ @@ -92,8 +92,4 @@ class GiphyBridge extends BridgeAbstract{ public function getCacheDuration(){ return 300; // 5 minutes } - - public function getUsername(){ - return $this->items[0]->username; - } } diff --git a/bridges/GuruMedBridge.php b/bridges/GuruMedBridge.php index fcc91c4..ec94415 100644 --- a/bridges/GuruMedBridge.php +++ b/bridges/GuruMedBridge.php @@ -6,10 +6,10 @@ class GuruMedBridge extends BridgeAbstract{ $this->name = "GuruMed"; $this->uri = "http://www.gurumed.org"; $this->description = "Returns the 5 newest posts from Gurumed (full text)"; - $this->update = "2016-08-03"; + $this->update = "2016-08-06"; } - function GurumedStripCDATA($string) { + private function GurumedStripCDATA($string) { $string = str_replace('', '', $string); return $string; diff --git a/bridges/HentaiHavenBridge.php b/bridges/HentaiHavenBridge.php index a1e938e..c5ef263 100644 --- a/bridges/HentaiHavenBridge.php +++ b/bridges/HentaiHavenBridge.php @@ -7,7 +7,7 @@ class HentaiHavenBridge extends BridgeAbstract{ $this->name = "Hentai Haven"; $this->uri = "http://hentaihaven.org/"; $this->description = "Returns releases from Hentai Haven"; - $this->update = "2015-01-16"; + $this->update = "2016-08-06"; } @@ -29,9 +29,6 @@ class HentaiHavenBridge extends BridgeAbstract{ public function getURI(){ return ''; } - public function getDescription(){ - return "Hentai Haven | Everything Else is Irrelevant"; - } public function getCacheDuration(){ return 21600; // 6 hours } diff --git a/bridges/KoreusBridge.php b/bridges/KoreusBridge.php index d605af0..80bb963 100644 --- a/bridges/KoreusBridge.php +++ b/bridges/KoreusBridge.php @@ -6,16 +6,16 @@ class KoreusBridge extends BridgeAbstract{ $this->name = "Koreus"; $this->uri = "http://www.koreus.com/"; $this->description = "Returns the 5 newest posts from Koreus (full text)"; - $this->update = "2016-08-03"; + $this->update = "2016-08-06"; } - function KoreusStripCDATA($string) { + private function KoreusStripCDATA($string) { $string = str_replace('', '', $string); return $string; } - function KoreusExtractContent($url) { + private function KoreusExtractContent($url) { $html2 = $this->file_get_html($url); $text = $html2->find('p[class=itemText]', 0)->innertext; $text = utf8_encode(preg_replace('/(Sur le m.+?)+$/i','',$text)); diff --git a/bridges/LeJournalDuGeekBridge.php b/bridges/LeJournalDuGeekBridge.php index 69f940a..0b6407b 100644 --- a/bridges/LeJournalDuGeekBridge.php +++ b/bridges/LeJournalDuGeekBridge.php @@ -6,16 +6,16 @@ class LeJournalDuGeekBridge extends BridgeAbstract{ $this->name = "journaldugeek.com (FR)"; $this->uri = "http://www.journaldugeek.com/"; $this->description = "Returns the 5 newest posts from LeJournalDuGeek (full text)."; - $this->update = "2016-08-03"; + $this->update = "2016-08-06"; } - function LeJournalDuGeekStripCDATA($string) { + private function LeJournalDuGeekStripCDATA($string) { $string = str_replace('', '', $string); return $string; } - function LeJournalDuGeekExtractContent($url) { + private function LeJournalDuGeekExtractContent($url) { $articleHTMLContent = $this->file_get_html($url); $text = $articleHTMLContent->find('div.post-content', 0)->innertext; diff --git a/bridges/LesJoiesDuCodeBridge.php b/bridges/LesJoiesDuCodeBridge.php index ddacb93..ab759dd 100644 --- a/bridges/LesJoiesDuCodeBridge.php +++ b/bridges/LesJoiesDuCodeBridge.php @@ -7,7 +7,7 @@ class LesJoiesDuCodeBridge extends BridgeAbstract{ $this->name = "Les Joies Du Code"; $this->uri = "http://lesjoiesducode.fr/"; $this->description = "LesJoiesDuCode"; - $this->update = "04/02/2015"; + $this->update = "2016-08-06"; } @@ -59,8 +59,4 @@ class LesJoiesDuCodeBridge extends BridgeAbstract{ public function getCacheDuration(){ return 7200; // 2h hours } - public function getDescription(){ - return "Les Joies Du Code via rss-bridge"; - } } -?> diff --git a/bridges/MsnMondeBridge.php b/bridges/MsnMondeBridge.php index 4b0e0ef..783f6e0 100644 --- a/bridges/MsnMondeBridge.php +++ b/bridges/MsnMondeBridge.php @@ -6,10 +6,10 @@ class MsnMondeBridge extends BridgeAbstract{ $this->name = "MSN Actu Monde"; $this->uri = "http://www.msn.com/fr-fr/actualite/monde"; $this->description = "Returns the 10 newest posts from MSN Actualités (full text)"; - $this->update = "2016-08-03"; + $this->update = "2016-08-06"; } - function MsnMondeExtractContent($url, &$item) { + private function MsnMondeExtractContent($url, &$item) { $html2 = $this->file_get_html($url); $item->content = $html2->find('#content', 0)->find('article', 0)->find('section', 0)->plaintext; $item->timestamp = strtotime($html2->find('.authorinfo-txt', 0)->find('time', 0)->datetime); diff --git a/bridges/NextInpactBridge.php b/bridges/NextInpactBridge.php index e4597e5..c3026bf 100644 --- a/bridges/NextInpactBridge.php +++ b/bridges/NextInpactBridge.php @@ -6,16 +6,16 @@ class NextInpactBridge extends BridgeAbstract { $this->name = "NextInpact Bridge"; $this->uri = "http://www.nextinpact.com/"; $this->description = "Returns the newest articles."; - $this->update = "2016-08-03"; + $this->update = "2016-08-06"; } - function StripCDATA($string) { + private function StripCDATA($string) { $string = str_replace('', '', $string); return $string; } - function ExtractContent($url) { + private function ExtractContent($url) { $html2 = $this->file_get_html($url); $text = '

'.$html2->find('span.sub_title', 0)->innertext.'

' .'

-

' diff --git a/bridges/NiceMatinBridge.php b/bridges/NiceMatinBridge.php index 407b92b..96b1921 100644 --- a/bridges/NiceMatinBridge.php +++ b/bridges/NiceMatinBridge.php @@ -6,10 +6,10 @@ class NiceMatinBridge extends BridgeAbstract{ $this->name = "NiceMatin"; $this->uri = "http://www.nicematin.com/"; $this->description = "Returns the 10 newest posts from NiceMatin (full text)"; - $this->update = "2016-08-03"; + $this->update = "2016-08-06"; } - function NiceMatinExtractContent($url) { + private function NiceMatinExtractContent($url) { $html = $this->file_get_html($url); if(!$html) $this->returnError('Could not acquire content from url: ' . $url . '!', 404); diff --git a/bridges/NovelUpdatesBridge.php b/bridges/NovelUpdatesBridge.php index b597755..ff5cd88 100644 --- a/bridges/NovelUpdatesBridge.php +++ b/bridges/NovelUpdatesBridge.php @@ -7,7 +7,7 @@ class NovelUpdatesBridge extends BridgeAbstract{ $this->name = "Novel Updates"; $this->uri = "http://www.novelupdates.com/"; $this->description = "Returns releases from Novel Updates"; - $this->update = "2016-05-21"; + $this->update = "2016-08-06"; $this->parameters[] = '[ { @@ -50,9 +50,6 @@ class NovelUpdatesBridge extends BridgeAbstract{ public function getURI(){ return 'http://www.novelupdates.com/'; } - public function getDescription(){ - return "Novel Updates - Directory of Translated Novels"; - } public function getCacheDuration(){ return 21600; // 6 hours } diff --git a/bridges/PlanetLibreBridge.php b/bridges/PlanetLibreBridge.php index 80a703b..cbfa023 100644 --- a/bridges/PlanetLibreBridge.php +++ b/bridges/PlanetLibreBridge.php @@ -6,10 +6,10 @@ class PlanetLibreBridge extends BridgeAbstract{ $this->name = "PlanetLibre"; $this->uri = "http://www.planet-libre.org"; $this->description = "Returns the 5 newest posts from PlanetLibre (full text)"; - $this->update = "2016-08-04"; + $this->update = "2016-08-06"; } - function PlanetLibreExtractContent($url){ + private function PlanetLibreExtractContent($url){ $html2 = $this->file_get_html($url); $text = $html2->find('div[class="post-text"]', 0)->innertext; return $text; diff --git a/bridges/ReporterreBridge.php b/bridges/ReporterreBridge.php index 1f5d021..b15c969 100644 --- a/bridges/ReporterreBridge.php +++ b/bridges/ReporterreBridge.php @@ -6,10 +6,10 @@ class ReporterreBridge extends BridgeAbstract{ $this->name = "Reporterre Bridge"; $this->uri = "http://www.reporterre.net/"; $this->description = "Returns the newest articles."; - $this->update = "2016-08-04"; + $this->update = "2016-08-06"; } - function ExtractContentReporterre($url) { + private function ExtractContentReporterre($url) { $html2 = $this->file_get_html($url); foreach($html2->find('div[style=text-align:justify]') as $e) { diff --git a/bridges/SensCritiqueBridge.php b/bridges/SensCritiqueBridge.php index cfd9e1c..f4b8fc7 100644 --- a/bridges/SensCritiqueBridge.php +++ b/bridges/SensCritiqueBridge.php @@ -8,7 +8,7 @@ class SensCritiqueBridge extends BridgeAbstract { $this->name = "Sens Critique"; $this->uri = "http://www.senscritique.com"; $this->description = "Sens Critique news"; - $this->update = "2016-07-29"; + $this->update = "2016-08-06"; $this->parameters[] = '[ @@ -63,7 +63,7 @@ class SensCritiqueBridge extends BridgeAbstract { } } - public function collectMoviesData() { + private function collectMoviesData() { $html = ''; $html = $this->file_get_html('http://www.senscritique.com/films/cette-semaine') or $this->returnError('No results for this query.', 404); $list = $html->find('ul.elpr-list', 0); @@ -71,7 +71,7 @@ class SensCritiqueBridge extends BridgeAbstract { $this->extractDataFromList($list); } - public function collectSeriesData() { + private function collectSeriesData() { $html = ''; $html = $this->file_get_html('http://www.senscritique.com/series/actualite') or $this->returnError('No results for this query.', 404); $list = $html->find('ul.elpr-list', 0); @@ -79,7 +79,7 @@ class SensCritiqueBridge extends BridgeAbstract { $this->extractDataFromList($list); } - public function collectGamesData() { + private function collectGamesData() { $html = ''; $html = $this->file_get_html('http://www.senscritique.com/jeuxvideo/actualite') or $this->returnError('No results for this query.', 404); $list = $html->find('ul.elpr-list', 0); @@ -87,7 +87,7 @@ class SensCritiqueBridge extends BridgeAbstract { $this->extractDataFromList($list); } - public function collectBooksData() { + private function collectBooksData() { $html = ''; $html = $this->file_get_html('http://www.senscritique.com/livres/actualite') or $this->returnError('No results for this query.', 404); $list = $html->find('ul.elpr-list', 0); @@ -95,7 +95,7 @@ class SensCritiqueBridge extends BridgeAbstract { $this->extractDataFromList($list); } - public function collectBDsData() { + private function collectBDsData() { $html = ''; $html = $this->file_get_html('http://www.senscritique.com/bd/actualite') or $this->returnError('No results for this query.', 404); $list = $html->find('ul.elpr-list', 0); @@ -103,7 +103,7 @@ class SensCritiqueBridge extends BridgeAbstract { $this->extractDataFromList($list); } - public function collectMusicsData() { + private function collectMusicsData() { $html = ''; $html = $this->file_get_html('http://www.senscritique.com/musique/actualite') or $this->returnError('No results for this query.', 404); $list = $html->find('ul.elpr-list', 0); @@ -111,7 +111,7 @@ class SensCritiqueBridge extends BridgeAbstract { $this->extractDataFromList($list); } - public function extractDataFromList($list) { + private function extractDataFromList($list) { if ($list === null) { $this->returnError('Cannot extract data from list', 400); } diff --git a/bridges/Sexactu.php b/bridges/Sexactu.php index 92f4d9f..cfa97a7 100644 --- a/bridges/Sexactu.php +++ b/bridges/Sexactu.php @@ -8,7 +8,7 @@ class Sexactu extends BridgeAbstract{ $this->name = "Sexactu"; $this->uri = "http://www.gqmagazine.fr"; $this->description = "Sexactu via rss-bridge"; - $this->update = "04/02/2014"; + $this->update = "2016-08-06"; } @@ -69,11 +69,8 @@ $replace = array('January', 'February', 'March', 'April', 'May', 'June', 'July', public function getCacheDuration(){ return 7200; // 2h hours } - public function getDescription(){ - return "Sexactu via rss-bridge"; - } - public function correctCase($str) { + private function correctCase($str) { $sentences=explode('.', mb_strtolower($str, "UTF-8")); $str=""; $sep=""; diff --git a/bridges/ShanaprojectBridge.php b/bridges/ShanaprojectBridge.php index 64c33b6..8a7f2c1 100644 --- a/bridges/ShanaprojectBridge.php +++ b/bridges/ShanaprojectBridge.php @@ -5,11 +5,11 @@ class ShanaprojectBridge extends BridgeAbstract { $this->name = $this->getName(); $this->uri = $this->getURI(); $this->description = 'Returns a list of anime from the current Season Anime List'; - $this->update = '2016-08-04'; + $this->update = '2016-08-06'; } // Returns an html object for the Season Anime List (latest season) - function LoadSeasonAnimeList(){ + private function LoadSeasonAnimeList(){ // First we need to find the URI to the latest season from the 'seasons' page searching for 'Season Anime List' $html = $this->file_get_html($this->getURI() . '/seasons'); if(!$html) @@ -27,7 +27,7 @@ class ShanaprojectBridge extends BridgeAbstract { } // Extracts the anime title - function ExtractAnimeTitle($anime){ + private function ExtractAnimeTitle($anime){ $title = $anime->find('a', 0); if(!$title) $this->returnError('Could not find anime title!', 404); @@ -35,7 +35,7 @@ class ShanaprojectBridge extends BridgeAbstract { } // Extracts the anime URI - function ExtractAnimeURI($anime){ + private function ExtractAnimeURI($anime){ $uri = $anime->find('a', 0); if(!$uri) $this->returnError('Could not find anime URI!', 404); @@ -43,7 +43,7 @@ class ShanaprojectBridge extends BridgeAbstract { } // Extracts the anime release date (timestamp) - function ExtractAnimeTimestamp($anime){ + private function ExtractAnimeTimestamp($anime){ $timestamp = $anime->find('span.header_info_block', 1); if(!$timestamp) $this->returnError('Could not find anime timestamp!', 404); @@ -51,7 +51,7 @@ class ShanaprojectBridge extends BridgeAbstract { } // Extracts the anime studio name (author) - function ExtractAnimeAuthor($anime){ + private function ExtractAnimeAuthor($anime){ $author = $anime->find('span.header_info_block', 2); if(!$author) return; // Sometimes the studio is unknown, so leave empty @@ -59,7 +59,7 @@ class ShanaprojectBridge extends BridgeAbstract { } // Extracts the episode information (x of y released) - function ExtractAnimeEpisodeInformation($anime){ + private function ExtractAnimeEpisodeInformation($anime){ $episode = $anime->find('div.header_info_episode', 0); if(!$episode) $this->returnError('Could not find anime episode information!', 404); @@ -67,7 +67,7 @@ class ShanaprojectBridge extends BridgeAbstract { } // Extracts the background image - function ExtractAnimeBackgroundImage($anime){ + private function ExtractAnimeBackgroundImage($anime){ // Getting the picture is a little bit tricky as it is part of the style. // Luckily the style is part of the parent div :) @@ -78,12 +78,12 @@ class ShanaprojectBridge extends BridgeAbstract { } // Builds an URI to search for a specific anime (subber is left empty) - function BuildAnimeSearchURI($anime){ + private function BuildAnimeSearchURI($anime){ return $this->getURI() . '/search/?title=' . urlencode($this->ExtractAnimeTitle($anime)) . '&subber='; } // Builds the content string for a given anime - function BuildAnimeContent($anime){ + private function BuildAnimeContent($anime){ // We'll use a template string to place our contents return ' ' . htmlspecialchars($this->ExtractAnimeTitle($anime)) . ' diff --git a/bridges/TheCodingLoveBridge.php b/bridges/TheCodingLoveBridge.php index e9eef5b..b23c6ee 100644 --- a/bridges/TheCodingLoveBridge.php +++ b/bridges/TheCodingLoveBridge.php @@ -7,7 +7,7 @@ class TheCodingLoveBridge extends BridgeAbstract{ $this->name = "The Coding Love"; $this->uri = "http://thecodinglove.com/"; $this->description = "The Coding Love"; - $this->update = "04/02/2015"; + $this->update = "2016-08-06"; } @@ -60,8 +60,4 @@ class TheCodingLoveBridge extends BridgeAbstract{ public function getCacheDuration(){ return 7200; // 2h hours } - public function getDescription(){ - return "The Coding Love via rss-bridge"; - } } -?> diff --git a/bridges/TwitterBridgeTweaked.php b/bridges/TwitterBridgeTweaked.php index e817ced..4f55fb9 100644 --- a/bridges/TwitterBridgeTweaked.php +++ b/bridges/TwitterBridgeTweaked.php @@ -7,7 +7,7 @@ class TwitterBridgeTweaked extends BridgeAbstract{ $this->name = "Twitter Bridge Tweaked"; $this->uri = "https://twitter.com/"; $this->description = "(same as Twitter Bridge Extended, but with cleaned title & content)"; - $this->update = "2014-12-05"; + $this->update = "2016-08-06"; $this->parameters["By keyword or hashtag"] = '[ @@ -158,8 +158,4 @@ class TwitterBridgeTweaked extends BridgeAbstract{ public function getCacheDuration(){ return 300; // 5 minutes } - - public function getUsername(){ - return $this->items[0]->username; - } } diff --git a/bridges/WordPressBridge.php b/bridges/WordPressBridge.php index 35ef3bf..69db325 100644 --- a/bridges/WordPressBridge.php +++ b/bridges/WordPressBridge.php @@ -12,7 +12,7 @@ class WordPressBridge extends BridgeAbstract { $this->name = "Wordpress Bridge"; $this->uri = "https://wordpress.org/"; $this->description = "Returns the 3 newest full posts of a Wordpress blog"; - $this->update = "2016-08-04"; + $this->update = "2016-08-06"; $this->parameters[] = '[ @@ -25,7 +25,7 @@ class WordPressBridge extends BridgeAbstract { } // Returns the content type for a given html dom - function DetectContentType($html){ + private function DetectContentType($html){ if($html->find('entry')) return WORDPRESS_TYPE_ATOM; if($html->find('item')) @@ -34,7 +34,7 @@ class WordPressBridge extends BridgeAbstract { } // Replaces all 'link' tags with 'url' for simplehtmldom to actually find 'links' ('url') - function ReplaceLinkTagsWithUrlTags($element){ + private function ReplaceLinkTagsWithUrlTags($element){ // We need to fix the 'link' tag as simplehtmldom cannot parse it (just rename it and load back as dom) $element_text = $element->outertext; $element_text = str_replace('', '', $element_text); @@ -43,13 +43,13 @@ class WordPressBridge extends BridgeAbstract { return str_get_html($element_text); } - function StripCDATA($string) { + private function StripCDATA($string) { $string = str_replace('', '', $string); return $string; } - function ClearContent($content) { + private function ClearContent($content) { $content = preg_replace('/]*>[^<]*<\/script>/', '', $content); $content = preg_replace('/
/', '', $content); diff --git a/bridges/WorldOfTanks.php b/bridges/WorldOfTanks.php index 0d7967c..3a1d2b4 100644 --- a/bridges/WorldOfTanks.php +++ b/bridges/WorldOfTanks.php @@ -12,7 +12,7 @@ class WorldOfTanks extends HttpCachingBridgeAbstract{ $this->name = "World of Tanks"; $this->uri = "http://worldoftanks.eu/"; $this->description = "News about the tank slaughter game."; - $this->update = "2015-09-12"; + $this->update = "2016-08-06"; $this->parameters[] = '[ @@ -79,7 +79,7 @@ class WorldOfTanks extends HttpCachingBridgeAbstract{ } } - public function parseLine($infoLink) { + private function parseLine($infoLink) { $item = new Item(); $item->uri = WORLD_OF_TANKS.$infoLink->href; // now load that uri from cache @@ -105,7 +105,4 @@ class WorldOfTanks extends HttpCachingBridgeAbstract{ public function getCacheDuration(){ return 3600; // 2h hours } - public function getDescription(){ - return "Toutes les actualités les plus brulantes de ce simulateur de destruction d'acier."; - } }