mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-13 03:54:04 +02:00
[bridges] use constants instead of variable members
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
<?php
|
||||
class BastaBridge extends BridgeAbstract{
|
||||
public $maintainer = "qwertygc";
|
||||
public $name = "Bastamag Bridge";
|
||||
public $uri = "http://www.bastamag.net/";
|
||||
public $description = "Returns the newest articles.";
|
||||
const MAINTAINER = "qwertygc";
|
||||
const NAME = "Bastamag Bridge";
|
||||
const URI = "http://www.bastamag.net/";
|
||||
const DESCRIPTION = "Returns the newest articles.";
|
||||
|
||||
public function collectData(){
|
||||
// Replaces all relative image URLs by absolute URLs. Relative URLs always start with 'local/'!
|
||||
function ReplaceImageUrl($content){
|
||||
return preg_replace('/src=["\']{1}([^"\']+)/ims', 'src=\''.$this->uri.'$1\'', $content);
|
||||
return preg_replace('/src=["\']{1}([^"\']+)/ims', 'src=\''.self::URI.'$1\'', $content);
|
||||
}
|
||||
|
||||
$html = $this->getSimpleHTMLDOM($this->uri.'spip.php?page=backend')
|
||||
$html = $this->getSimpleHTMLDOM(self::URI.'spip.php?page=backend')
|
||||
or $this->returnServerError('Could not request Bastamag.');
|
||||
$limit = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user