maintainer = "ORelio"; $this->name = 'Silicon Bridge'; $this->uri = 'http://www.silicon.fr/'; $this->description = "Returns the newest articles."; $this->update = '2016-08-17'; } public function collectData(array $param) { function StripCDATA($string) { $string = str_replace('', '', $string); return $string; } $feedUrl = 'http://www.silicon.fr/feed'; $html = $this->getSimpleHTMLDOM($feedUrl) or $this->returnServerError('Could not request Silicon: '.$feedUrl); $limit = 0; foreach($html->find('item') as $element) { if($limit < 5) { //Retrieve article Uri and get that page $article_uri = $element->innertext; $article_uri = substr($article_uri, strpos($article_uri, '') + 6); $article_uri = substr($article_uri, 0, strpos($article_uri, '')); $article_html = $this->getSimpleHTMLDOM($article_uri) or $this->returnServerError('Could not request Silicon: '.$article_uri); //Build article contents from corresponding elements $thumbnailUri = $element->find('enclosure', 0)->url; $article_content = '
' .''.$article_html->find('div.entry-excerpt', 0)->plaintext.'
' .$article_html->find('div.entry-content', 0)->innertext; //Remove useless scripts left in the page while (strpos($article_content, '