Minor things
This commit is contained in:
parent
485a0dc279
commit
9b86dfdb39
1 changed files with 4 additions and 8 deletions
|
@ -7,6 +7,7 @@
|
||||||
* @maintainer corenting
|
* @maintainer corenting
|
||||||
*/
|
*/
|
||||||
class ProjectMGameBridge extends BridgeAbstract{
|
class ProjectMGameBridge extends BridgeAbstract{
|
||||||
|
|
||||||
public function collectData(array $param){
|
public function collectData(array $param){
|
||||||
$html = '';
|
$html = '';
|
||||||
$html = file_get_html('http://projectmgame.com/en/') or $this->returnError('Error while downloading the Project M homepage', 404);
|
$html = file_get_html('http://projectmgame.com/en/') or $this->returnError('Error while downloading the Project M homepage', 404);
|
||||||
|
@ -18,17 +19,12 @@ class ProjectMGameBridge extends BridgeAbstract{
|
||||||
|
|
||||||
$p_list = $article->find('section p');
|
$p_list = $article->find('section p');
|
||||||
$content = '';
|
$content = '';
|
||||||
foreach($p_list as $p)
|
foreach($p_list as $p) $content .= $p->innertext;
|
||||||
{
|
|
||||||
$content .= $p->innertext;
|
|
||||||
}
|
|
||||||
$item->content = $content;
|
$item->content = $content;
|
||||||
|
|
||||||
// get publication date
|
// get publication date
|
||||||
$str_date = $article->find('section div.info_block a',0)->innertext;
|
$str_date = $article->find('section div.info_block a',0)->innertext;
|
||||||
$timestamp = strtotime($str_date);
|
$item->timestamp = strtotime($str_date);
|
||||||
$item->timestamp = $timestamp;
|
|
||||||
|
|
||||||
$this->items[] = $item;
|
$this->items[] = $item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,6 +38,6 @@ class ProjectMGameBridge extends BridgeAbstract{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCacheDuration(){
|
public function getCacheDuration(){
|
||||||
return 10800;
|
return 10800; //3 hours
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue