1
0
Fork 0
forked from blallo/rss-bridge

[WorldOfTanksBridge] code simplification

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière 2016-08-30 00:11:25 +02:00
parent 23bb5c5dfb
commit 6e3f08e9d3

View file

@ -27,11 +27,7 @@ class WorldOfTanksBridge extends HttpCachingBridgeAbstract{
)); ));
function getURI(){ function getURI(){
$lang='fr';
if (!empty($this->getInput('lang'))) {
$lang = $this->getInput('lang'); $lang = $this->getInput('lang');
}
$uri = $this->uri.$lang.'/news/'; $uri = $this->uri.$lang.'/news/';
if(!empty($this->getInput('category'))) { if(!empty($this->getInput('category'))) {
$uri .= 'pc-browser/'.$this->getInput('category')."/"; $uri .= 'pc-browser/'.$this->getInput('category')."/";
@ -40,7 +36,8 @@ class WorldOfTanksBridge extends HttpCachingBridgeAbstract{
} }
public function collectData(){ public function collectData(){
$html = $this->getSimpleHTMLDOM($this->getURI()) or $this->returnServerError('Could not request '.$this->getURI()); $html = $this->getSimpleHTMLDOM($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->name = $html->find('title', 0)->innertext;