mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-23 23:16:53 +00:00
Fix bridges FSBridge & GuruMedBridge due to PSR-2:
"Visibility MUST be declared on all methods."
This commit is contained in:
parent
fd4af15ce6
commit
0928318943
@ -8,33 +8,35 @@
|
||||
*/
|
||||
class FSBridge extends BridgeAbstract
|
||||
{
|
||||
public function FS_StripCDATA($string)
|
||||
{
|
||||
$string = str_replace('<![CDATA[', '', $string);
|
||||
$string = str_replace(']]>', '', $string);
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
public function FS_ExtractContent($url)
|
||||
{
|
||||
$html2 = file_get_html($url);
|
||||
$text = $html2->find('div.fiche-actualite', 0)->innertext;
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
public function collectData(array $param)
|
||||
{
|
||||
public function FS_StripCDATA($string)
|
||||
{
|
||||
$string = str_replace('<![CDATA[', '', $string);
|
||||
$string = str_replace(']]>', '', $string);
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
public function FS_ExtractContent($url)
|
||||
{
|
||||
$html2 = file_get_html($url);
|
||||
$text = $html2->find('div.fiche-actualite', 0)->innertext;
|
||||
|
||||
return $text;
|
||||
}
|
||||
$html = file_get_html('http://www.futura-sciences.com/rss/actualites.xml') or $this->returnError('Could not request Futura Sciences.', 404);
|
||||
$limit = 0;
|
||||
|
||||
foreach ($html->find('item') as $element) {
|
||||
if ($limit < 20) {
|
||||
$item = new \Item();
|
||||
$item->title = FS_StripCDATA($element->find('title', 0)->innertext);
|
||||
$item->uri = FS_StripCDATA($element->find('guid', 0)->plaintext);
|
||||
$item->title = $this->FS_StripCDATA($element->find('title', 0)->innertext);
|
||||
$item->uri = $this->FS_StripCDATA($element->find('guid', 0)->plaintext);
|
||||
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item->content = FS_ExtractContent($item->uri);
|
||||
$item->content = $this->FS_ExtractContent($item->uri);
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
@ -8,33 +8,35 @@
|
||||
*/
|
||||
class GuruMedBridge extends BridgeAbstract
|
||||
{
|
||||
public function GurumedStripCDATA($string)
|
||||
{
|
||||
$string = str_replace('<![CDATA[', '', $string);
|
||||
$string = str_replace(']]>', '', $string);
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
public function GurumedExtractContent($url)
|
||||
{
|
||||
$html2 = file_get_html($url);
|
||||
$text = $html2->find('div.entry', 0)->innertext;
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
public function collectData(array $param)
|
||||
{
|
||||
public function GurumedStripCDATA($string)
|
||||
{
|
||||
$string = str_replace('<![CDATA[', '', $string);
|
||||
$string = str_replace(']]>', '', $string);
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
public function GurumedExtractContent($url)
|
||||
{
|
||||
$html2 = file_get_html($url);
|
||||
$text = $html2->find('div.entry', 0)->innertext;
|
||||
|
||||
return $text;
|
||||
}
|
||||
$html = file_get_html('http://gurumed.org/feed') or $this->returnError('Could not request Gurumed.', 404);
|
||||
$limit = 0;
|
||||
|
||||
foreach ($html->find('item') as $element) {
|
||||
if ($limit < 10) {
|
||||
$item = new \Item();
|
||||
$item->title = GurumedStripCDATA($element->find('title', 0)->innertext);
|
||||
$item->uri = GurumedStripCDATA($element->find('guid', 0)->plaintext);
|
||||
$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 = GurumedExtractContent($item->uri);
|
||||
$item->content = $this->GurumedExtractContent($item->uri);
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user