[AllocineFRBridge] code simplification

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière 2016-09-01 23:52:54 +02:00
parent d8ebcc9376
commit 147154f44c

View file

@ -24,13 +24,13 @@ class AllocineFRBridge extends BridgeAbstract{
public function getURI(){ public function getURI(){
switch($this->getInput('category')){ switch($this->getInput('category')){
case 'faux-raccord': case 'faux-raccord':
$uri = 'http://www.allocine.fr/video/programme-12284/saison-24580/'; $uri = static::URI.'video/programme-12284/saison-24580/';
break; break;
case 'top-5': case 'top-5':
$uri = 'http://www.allocine.fr/video/programme-12299/saison-22542/'; $uri = static::URI.'video/programme-12299/saison-22542/';
break; break;
case 'tueurs-en-serie': case 'tueurs-en-serie':
$uri = 'http://www.allocine.fr/video/programme-12286/saison-22938/'; $uri = static::URI.'video/programme-12286/saison-22938/';
break; break;
} }
@ -66,13 +66,13 @@ class AllocineFRBridge extends BridgeAbstract{
if($figCaption !== false) if($figCaption !== false)
{ {
$content = str_replace('src="/', 'src="http://www.allocine.fr/', $content); $content = str_replace('src="/', 'src="'.static::URI, $content);
$content = str_replace('href="/', 'href="http://www.allocine.fr/', $content); $content = str_replace('href="/', 'href="'.static::URI, $content);
$content = str_replace('src=\'/', 'src=\'http://www.allocine.fr/', $content); $content = str_replace('src=\'/', 'src=\''.static::URI, $content);
$content = str_replace('href=\'/', 'href=\'http://www.allocine.fr/', $content); $content = str_replace('href=\'/', 'href=\''.static::URI, $content);
$item['content'] = $content; $item['content'] = $content;
$item['title'] = trim($title->innertext); $item['title'] = trim($title->innertext);
$item['uri'] = "http://www.allocine.fr" . $title->href; $item['uri'] = static::URI . $title->href;
$this->items[] = $item; $this->items[] = $item;
} }
} }