[WorldOfTanksBridge] fix getName()
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
parent
abc4f047bf
commit
9d7e64fac0
1 changed files with 7 additions and 1 deletions
|
@ -26,6 +26,8 @@ class WorldOfTanksBridge extends HttpCachingBridgeAbstract{
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
private $title='';
|
||||||
|
|
||||||
function getURI(){
|
function getURI(){
|
||||||
$lang = $this->getInput('lang');
|
$lang = $this->getInput('lang');
|
||||||
$uri = $this->uri.$lang.'/news/';
|
$uri = $this->uri.$lang.'/news/';
|
||||||
|
@ -35,12 +37,16 @@ class WorldOfTanksBridge extends HttpCachingBridgeAbstract{
|
||||||
return $uri;
|
return $uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getName(){
|
||||||
|
return $this->title?:$this->name;
|
||||||
|
}
|
||||||
|
|
||||||
public function collectData(){
|
public function collectData(){
|
||||||
$html = $this->getSimpleHTMLDOM($this->getURI())
|
$html = $this->getSimpleHTMLDOM($this->getURI())
|
||||||
or $this->returnServerError('Could not request '.$this->getURI());
|
or $this->returnServerError('Could not request '.$this->getURI());
|
||||||
$this->debugMessage("loaded HTML from ".$this->getURI());
|
$this->debugMessage("loaded HTML from ".$this->getURI());
|
||||||
// customize name
|
// customize name
|
||||||
$this->name = $html->find('title', 0)->innertext;
|
$this->title = $html->find('title', 0)->innertext;
|
||||||
foreach($html->find('.b-imgblock_ico') as $infoLink) {
|
foreach($html->find('.b-imgblock_ico') as $infoLink) {
|
||||||
$this->parseLine($infoLink);
|
$this->parseLine($infoLink);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue