forked from blallo/rss-bridge
[CourrierInternationalBridge] fix uri value and code simplification
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
parent
6f8a773260
commit
963bbcc402
1 changed files with 4 additions and 7 deletions
|
@ -3,16 +3,13 @@ class CourrierInternationalBridge extends BridgeAbstract{
|
||||||
|
|
||||||
public $maintainer = "teromene";
|
public $maintainer = "teromene";
|
||||||
public $name = "Courrier International Bridge";
|
public $name = "Courrier International Bridge";
|
||||||
public $uri = "http://CourrierInternational.fr/";
|
public $uri = "http://CourrierInternational.com/";
|
||||||
public $description = "Courrier International bridge";
|
public $description = "Courrier International bridge";
|
||||||
|
|
||||||
public function collectData(){
|
public function collectData(){
|
||||||
|
|
||||||
$html = '';
|
$html = $this->getSimpleHTMLDOM($this->uri)
|
||||||
|
or $this->returnServerError('Error.');
|
||||||
$html = $this->getSimpleHTMLDOM('http://www.courrierinternational.com/') or $this->returnServerError('Error.');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$element = $html->find("article");
|
$element = $html->find("article");
|
||||||
|
|
||||||
|
@ -25,7 +22,7 @@ class CourrierInternationalBridge extends BridgeAbstract{
|
||||||
$item['uri'] = $article->parent->getAttribute("href");
|
$item['uri'] = $article->parent->getAttribute("href");
|
||||||
|
|
||||||
if(strpos($item['uri'], "http") === FALSE) {
|
if(strpos($item['uri'], "http") === FALSE) {
|
||||||
$item['uri'] = "http://courrierinternational.fr/".$item['uri'];
|
$item['uri'] = $this->uri.$item['uri'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$page = $this->getSimpleHTMLDOM($item['uri']);
|
$page = $this->getSimpleHTMLDOM($item['uri']);
|
||||||
|
|
Loading…
Reference in a new issue