mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-24 15:27:23 +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,8 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
class FSBridge extends BridgeAbstract
|
class FSBridge extends BridgeAbstract
|
||||||
{
|
{
|
||||||
public function collectData(array $param)
|
|
||||||
{
|
|
||||||
public function FS_StripCDATA($string)
|
public function FS_StripCDATA($string)
|
||||||
{
|
{
|
||||||
$string = str_replace('<![CDATA[', '', $string);
|
$string = str_replace('<![CDATA[', '', $string);
|
||||||
@ -25,16 +23,20 @@ class FSBridge extends BridgeAbstract
|
|||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function collectData(array $param)
|
||||||
|
{
|
||||||
|
|
||||||
$html = file_get_html('http://www.futura-sciences.com/rss/actualites.xml') or $this->returnError('Could not request Futura Sciences.', 404);
|
$html = file_get_html('http://www.futura-sciences.com/rss/actualites.xml') or $this->returnError('Could not request Futura Sciences.', 404);
|
||||||
$limit = 0;
|
$limit = 0;
|
||||||
|
|
||||||
foreach ($html->find('item') as $element) {
|
foreach ($html->find('item') as $element) {
|
||||||
if ($limit < 20) {
|
if ($limit < 20) {
|
||||||
$item = new \Item();
|
$item = new \Item();
|
||||||
$item->title = FS_StripCDATA($element->find('title', 0)->innertext);
|
$item->title = $this->FS_StripCDATA($element->find('title', 0)->innertext);
|
||||||
$item->uri = FS_StripCDATA($element->find('guid', 0)->plaintext);
|
$item->uri = $this->FS_StripCDATA($element->find('guid', 0)->plaintext);
|
||||||
$item->timestamp = strtotime($element->find('pubDate', 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;
|
$this->items[] = $item;
|
||||||
$limit++;
|
$limit++;
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
class GuruMedBridge extends BridgeAbstract
|
class GuruMedBridge extends BridgeAbstract
|
||||||
{
|
{
|
||||||
public function collectData(array $param)
|
|
||||||
{
|
|
||||||
public function GurumedStripCDATA($string)
|
public function GurumedStripCDATA($string)
|
||||||
{
|
{
|
||||||
$string = str_replace('<![CDATA[', '', $string);
|
$string = str_replace('<![CDATA[', '', $string);
|
||||||
@ -25,16 +23,20 @@ class GuruMedBridge extends BridgeAbstract
|
|||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function collectData(array $param)
|
||||||
|
{
|
||||||
|
|
||||||
$html = file_get_html('http://gurumed.org/feed') or $this->returnError('Could not request Gurumed.', 404);
|
$html = file_get_html('http://gurumed.org/feed') or $this->returnError('Could not request Gurumed.', 404);
|
||||||
$limit = 0;
|
$limit = 0;
|
||||||
|
|
||||||
foreach ($html->find('item') as $element) {
|
foreach ($html->find('item') as $element) {
|
||||||
if ($limit < 10) {
|
if ($limit < 10) {
|
||||||
$item = new \Item();
|
$item = new \Item();
|
||||||
$item->title = GurumedStripCDATA($element->find('title', 0)->innertext);
|
$item->title = $this->GurumedStripCDATA($element->find('title', 0)->innertext);
|
||||||
$item->uri = GurumedStripCDATA($element->find('guid', 0)->plaintext);
|
$item->uri = $this->GurumedStripCDATA($element->find('guid', 0)->plaintext);
|
||||||
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
|
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
|
||||||
$item->content = GurumedExtractContent($item->uri);
|
$item->content = $this->GurumedExtractContent($item->uri);
|
||||||
$this->items[] = $item;
|
$this->items[] = $item;
|
||||||
$limit++;
|
$limit++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user