forked from blallo/rss-bridge
[Wikipedia] Remove other bridges
All previous bridges are now completely covered by the new WikipediaBridge!
This commit is contained in:
parent
2c954a848d
commit
d4435e0b13
4 changed files with 0 additions and 182 deletions
|
@ -1,48 +0,0 @@
|
||||||
<?php
|
|
||||||
class WikipediaDEBridge extends BridgeAbstract{
|
|
||||||
|
|
||||||
public function loadMetadatas() {
|
|
||||||
|
|
||||||
$this->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
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,44 +0,0 @@
|
||||||
<?php
|
|
||||||
class WikipediaENBridge extends BridgeAbstract{
|
|
||||||
|
|
||||||
public function loadMetadatas() {
|
|
||||||
|
|
||||||
$this->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
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,44 +0,0 @@
|
||||||
<?php
|
|
||||||
class WikipediaEOBridge extends BridgeAbstract{
|
|
||||||
|
|
||||||
public function loadMetadatas() {
|
|
||||||
|
|
||||||
$this->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
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,46 +0,0 @@
|
||||||
<?php
|
|
||||||
class WikipediaFRBridge extends BridgeAbstract{
|
|
||||||
|
|
||||||
public function loadMetadatas() {
|
|
||||||
|
|
||||||
$this->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
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue