diff --git a/bridges/ProjectMGameBridge.php b/bridges/ProjectMGameBridge.php new file mode 100644 index 00000000..abc2b9c4 --- /dev/null +++ b/bridges/ProjectMGameBridge.php @@ -0,0 +1,47 @@ +returnError('Error while downloading the Project M homepage', 404); + + foreach($html->find('article') as $article) { + $item = new \Item(); + $item->uri = 'http://projectmgame.com/en/'.$article->find('section div.info_block a',0)->href; + $item->title = $article->find('h1 p',0)->innertext; + + $p_list = $article->find('section p'); + $content = ''; + foreach($p_list as $p) + { + $content .= $p->innertext; + } + $item->content = $content; + + // get publication date + $str_date = $article->find('section div.info_block a',0)->innertext; + $timestamp = strtotime($str_date); + $item->timestamp = $timestamp; + + $this->items[] = $item; + } + } + + public function getName(){ + return 'Project M Game Bridge'; + } + + public function getURI(){ + return 'http://projectmgame.com/en/'; + } + + public function getCacheDuration(){ + return 10800; + } +}