find('div[class=field--type-text-with-summary]', 0)->innertext; $html3->clear(); unset ($html3); return $text; } $html = file_get_html('http://www.commondreams.org/rss.xml') or $this->returnError('Could not request CommonDreams.', 404); $limit = 0; foreach($html->find('item') as $element) { if($limit < 4) { $item = new \Item(); $item->title = $element->find('title', 0)->innertext; $item->uri = CommonDreamsUrl($element->find('guid', 0)->innertext); $item->timestamp = strtotime($element->find('pubDate', 0)->plaintext); $item->content = CommonDreamsExtractContent($item->uri); $this->items[] = $item; $limit++; } } } public function getName(){ return 'CommonDreams Bridge'; } public function getURI(){ return 'http://www.commondreams.org/'; } public function getCacheDuration(){ return 3600; // 1 hours // return 0; } }