[bridges] removed since they just parse the site feed

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière 2016-09-14 13:31:43 +02:00
parent 1819943451
commit 6f8b93fb46
2 changed files with 0 additions and 66 deletions

View File

@ -1,32 +0,0 @@
<?php
class GuruMedBridge extends BridgeAbstract{
const MAINTAINER = "qwertygc";
const NAME = "GuruMed";
const URI = "http://www.gurumed.org";
const DESCRIPTION = "Returns the 5 newest posts from Gurumed (full text)";
private function GurumedStripCDATA($string) {
$string = str_replace('<![CDATA[', '', $string);
$string = str_replace(']]>', '', $string);
return $string;
}
public function collectData(){
$html = $this->getSimpleHTMLDOM(self::URI.'feed')
or $this->returnServerError('Could not request Gurumed.');
$limit = 0;
foreach($html->find('item') as $element) {
if($limit < 5) {
$item = array();
$item['title'] = $this->GurumedStripCDATA($element->find('title', 0)->innertext);
$item['uri'] = $this->GurumedStripCDATA($element->find('guid', 0)->plaintext);
$item['timestamp'] = strtotime($element->find('pubDate', 0)->plaintext);
$item['content'] = $this->GurumedStripCDATA(strip_tags($element->find('description', 0), '<p><a><br>'));
$this->items[] = $item;
$limit++;
}
}
}
}

View File

@ -1,34 +0,0 @@
<?php
class ZoneTelechargementBridge extends BridgeAbstract {
const MAINTAINER = 'ORelio';
const NAME = 'Zone Telechargement Bridge';
const URI = 'https://www.zone-telechargement.com/';
const DESCRIPTION = 'RSS proxy returning the newest releases.<br />You may specify a category found in RSS URLs, else main feed is selected.';
const PARAMETERS = array( array(
'category'=>array('name'=>'Category')
));
public function collectData(){
function StripCDATA($string) {
$string = str_replace('<![CDATA[', '', $string);
$string = str_replace(']]>', '', $string);
return $string;
}
$url = $this->getURI().$this->getInput('category').'rss.xml';
$html = $this->getSimpleHTMLDOM($url) or $this->returnServerError('Could not request Zone Telechargement: '.$url);
foreach($html->find('item') as $element) {
$item = array();
$item['title'] = $element->find('title', 0)->plaintext;
$item['uri'] = str_replace('http://', 'https://', $element->find('guid', 0)->plaintext);
$item['timestamp'] = strtotime($element->find('pubDate', 0)->plaintext);
$item['content'] = StripCDATA($element->find('description', 0)->innertext);
$this->items[] = $item;
$limit++;
}
}
}