From 8c18c02c65042add22ef783e0f52a0483f3ffcb3 Mon Sep 17 00:00:00 2001
From: Corentin Garcia
' . $article_html->find('div.article_top_description', 0)->innertext . '
'; + $hero_image = 'getAttribute('data-src') . '>'; + + $article_body = $article_html->find('div.TGN_Article_ReadTimeSection', 0); + // Convert iframe of Youtube videos to link + foreach($article_body->find('iframe') as $found) { + + $iframeUrl = $found->getAttribute('src'); + + if ($iframeUrl) { + $text = 'Embedded Youtube video, click here to watch on Youtube.com'; + $found->outertext = ''; + } + } + // Remove CSS ressources + foreach($article_body->find('link') as $found) { + + $linkedRessourceUrl = $found->getAttribute('href'); + + if (str_ends_with($linkedRessourceUrl, '.css')) { + $found->outertext = ''; + } + } + $article_body = sanitize($article_body->innertext); + + $item['content'] = $top_description . $hero_image . $article_body; + + return $item; + } + + public function collectData(){ + $feed = static::URI . '/rss'; + $this->collectExpandableDatas($feed); + } +}