[ProjectMGameBridge] code simplification

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière 2016-08-29 21:54:25 +02:00
parent 662c1b6410
commit 08158825d9

View file

@ -8,12 +8,12 @@ class ProjectMGameBridge extends BridgeAbstract{
public function collectData(){ public function collectData(){
$html = ''; $html = $this->getSimpleHTMLDOM($this->uri)
$html = $this->getSimpleHTMLDOM('http://projectmgame.com/en/') or $this->returnServerError('Error while downloading the Project M homepage'); or $this->returnServerError('Error while downloading the Project M homepage');
foreach($html->find('article') as $article) { foreach($html->find('article') as $article) {
$item = array(); $item = array();
$item['uri'] = 'http://projectmgame.com/en/'.$article->find('section div.info_block a',0)->href; $item['uri'] = $this->uri.$article->find('section div.info_block a',0)->href;
$item['title'] = $article->find('h1 p',0)->innertext; $item['title'] = $article->find('h1 p',0)->innertext;
$p_list = $article->find('section p'); $p_list = $article->find('section p');