forked from blallo/rss-bridge
[WorldOfTanksBridge] code simplification
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
parent
23bb5c5dfb
commit
6e3f08e9d3
1 changed files with 3 additions and 6 deletions
|
@ -27,11 +27,7 @@ class WorldOfTanksBridge extends HttpCachingBridgeAbstract{
|
||||||
));
|
));
|
||||||
|
|
||||||
function getURI(){
|
function getURI(){
|
||||||
$lang='fr';
|
$lang = $this->getInput('lang');
|
||||||
if (!empty($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;
|
||||||
|
|
Loading…
Reference in a new issue