From d4435e0b13f706cdd3a84b7ccd17e46ad44cc2bd Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sun, 7 Aug 2016 00:07:28 +0200 Subject: [PATCH] [Wikipedia] Remove other bridges All previous bridges are now completely covered by the new WikipediaBridge! --- bridges/WikipediaDEBridge.php | 48 ----------------------------------- bridges/WikipediaENBridge.php | 44 -------------------------------- bridges/WikipediaEOBridge.php | 44 -------------------------------- bridges/WikipediaFRBridge.php | 46 --------------------------------- 4 files changed, 182 deletions(-) delete mode 100644 bridges/WikipediaDEBridge.php delete mode 100644 bridges/WikipediaENBridge.php delete mode 100644 bridges/WikipediaEOBridge.php delete mode 100644 bridges/WikipediaFRBridge.php diff --git a/bridges/WikipediaDEBridge.php b/bridges/WikipediaDEBridge.php deleted file mode 100644 index 5bb974a8..00000000 --- a/bridges/WikipediaDEBridge.php +++ /dev/null @@ -1,48 +0,0 @@ -maintainer = "cnlpete"; - $this->name = "Wikipedia DE Today's Featured Article..."; - $this->uri = "https://de.wikipedia.org/"; - $this->description = "Returns the highlighted en.wikipedia.org article."; - $this->update = "2015-11-04"; - - } - - public function collectData(array $param){ - $html = ''; - $host = 'http://de.wikipedia.org'; - // If you want HTTPS access instead, uncomment the following line: - //$host = 'https://de.wikipedia.org'; - $link = '/wiki/Wikipedia:Hauptseite'; - - $html = $this->file_get_html($host.$link) or $this->returnError('Could not request Wikipedia DE.', 404); - - $element = $html->find('div[id=mf-tfa]', 0); - $element->find('div', -1)->outertext = ''; - - $item = new \Item(); - $item->uri = $host.$element->find('p', 0)->find('a', 0)->href; - $item->title = $element->find('p',0)->find('a',0)->title; - - $html2 = $this->file_get_html($item->uri) or $this->returnError('Could not request Wikipedia DE '.$item->title.'.', 404); - $element2 = $html2->find('div[id=mw-content-text]', 0); - $item->content = str_replace('href="/', 'href="'.$host.'/', $element2->innertext); - - $this->items[] = $item; - } - - public function getName(){ - return 'Wikipedia DE "Today\'s Featured Article"'; - } - - public function getURI(){ - return 'https://de.wikipedia.org/wiki/Wikipedia:Hauptseite'; - } - - public function getCacheDuration(){ - return 3600*8; // 8 hours - } -} diff --git a/bridges/WikipediaENBridge.php b/bridges/WikipediaENBridge.php deleted file mode 100644 index 37f1f57a..00000000 --- a/bridges/WikipediaENBridge.php +++ /dev/null @@ -1,44 +0,0 @@ -maintainer = "gsurrel"; - $this->name = "Wikipedia EN 'Today's Featured Article...'"; - $this->uri = "https://en.wikipedia.org/"; - $this->description = "Returns the highlighted en.wikipedia.org article."; - $this->update = "2014-05-25"; - - } - - public function collectData(array $param){ - $html = ''; - $host = 'http://en.wikipedia.org'; - // If you want HTTPS access instead, uncomment the following line: - //$host = 'https://en.wikipedia.org'; - $link = '/wiki/Main_Page'; - - $html = $this->file_get_html($host.$link) or $this->returnError('Could not request Wikipedia EN.', 404); - - $element = $html->find('div[id=mp-tfa]', 0); - // Clean the bottom of the featured article - $element->find('div', -1)->outertext = ''; - $item = new \Item(); - $item->uri = $host.$element->find('p', 0)->find('a', 0)->href; - $item->title = $element->find('p',0)->find('a',0)->title; - $item->content = str_replace('href="/', 'href="'.$host.'/', $element->innertext); - $this->items[] = $item; - } - - public function getName(){ - return 'Wikipedia EN "Today\'s Featued Article"'; - } - - public function getURI(){ - return 'https://en.wikipedia.org/wiki/Main_Page'; - } - - public function getCacheDuration(){ - return 3600*4; // 4 hours - } -} diff --git a/bridges/WikipediaEOBridge.php b/bridges/WikipediaEOBridge.php deleted file mode 100644 index 4ca8864c..00000000 --- a/bridges/WikipediaEOBridge.php +++ /dev/null @@ -1,44 +0,0 @@ -maintainer = "gsurrel"; - $this->name = "Wikipedia EO 'Artikolo de la semajno'"; - $this->uri = "https://eo.wikipedia.org/"; - $this->description = "Returns the highlighted eo.wikipedia.org article."; - $this->update = "2014-05-25"; - - } - - public function collectData(array $param){ - $html = ''; - $host = 'http://eo.wikipedia.org'; - // If you want HTTPS access instead, uncomment the following line: - //$host = 'https://eo.wikipedia.org'; - $link = '/wiki/Vikipedio:%C4%88efpa%C4%9Do'; - - $html = $this->file_get_html($host.$link) or $this->returnError('Could not request Wikipedia EO.', 404); - - $element = $html->find('div[id=mf-artikolo-de-la-semajno]', 0); - // Link to article - $link = $element->find('p', 3)->find('a', 0); - $item = new \Item(); - $item->uri = $host.$link->href; - $item->title = $element->find('p',0)->find('i',0)->innertext; - $item->content = str_replace('href="/', 'href="'.$host.'/', $element->innertext); - $this->items[] = $item; - } - - public function getName(){ - return 'Wikipedia EO "Artikolo de la semajno"'; - } - - public function getURI(){ - return 'https://eo.wikipedia.org/wiki/Vikipedio:%C4%88efpa%C4%9Do'; - } - - public function getCacheDuration(){ - return 3600*12; // 12 hours - } -} diff --git a/bridges/WikipediaFRBridge.php b/bridges/WikipediaFRBridge.php deleted file mode 100644 index 293d7c99..00000000 --- a/bridges/WikipediaFRBridge.php +++ /dev/null @@ -1,46 +0,0 @@ -maintainer = "gsurrel"; - $this->name = "Wikipedia FR 'Lumière sur...'"; - $this->uri = "https://fr.wikipedia.org/"; - $this->description = "Returns the highlighted fr.wikipedia.org article."; - $this->update = "2016-06-04"; - - } - - public function collectData(array $param){ - $html = ''; - $host = 'http://fr.wikipedia.org'; - // If you want HTTPS access instead, uncomment the following line: - //$host = 'https://fr.wikipedia.org'; - $link = '/wiki/Wikip%C3%A9dia:Accueil_principal'; - - $html = $this->file_get_html($host.$link) or $this->returnError('Could not request Wikipedia FR.', 404); - - $element = $html->find('div[id=mf-lumieresur]', 0); - # Use the "Lire la suite" link to dependably get the title of the article - # usually it's a child of a li.BA element (Bon article) - # occasionally it's a li.AdQ (Article de qualité) - $lirelasuite_link = $element->find('.BA > i > a, .AdQ > i > a', 0); - $item = new \Item(); - $item->uri = $host.$lirelasuite_link->href; - $item->title = $lirelasuite_link->title; - $item->content = str_replace('href="/', 'href="'.$host.'/', $element->innertext); - $this->items[] = $item; - } - - public function getName(){ - return 'Wikipedia FR "Lumière sur..."'; - } - - public function getURI(){ - return 'https://fr.wikipedia.org/wiki/Wikip%C3%A9dia:Accueil_principal'; - } - - public function getCacheDuration(){ - return 3600*4; // 4 hours - } -}