From ba43c8795291214cc0e1b19bc3da6e768449e8ca Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Wed, 4 Dec 2019 18:23:11 +0100 Subject: [PATCH] [RevolutBridge] Remove bridge An official RSS feed is available at https://blog.revolut.com/rss/ Note that there is also an invisible "RSS" button next to the Facebook and Twitter icons at the menu bar. References #1321 --- bridges/RevolutBridge.php | 81 --------------------------------------- 1 file changed, 81 deletions(-) delete mode 100644 bridges/RevolutBridge.php diff --git a/bridges/RevolutBridge.php b/bridges/RevolutBridge.php deleted file mode 100644 index 04ca3770..00000000 --- a/bridges/RevolutBridge.php +++ /dev/null @@ -1,81 +0,0 @@ -find('url'), 0, 15); - - foreach($articles as $article) { - $item = array(); - - $item['uri'] = $article->find('loc', 0)->plaintext; - $item['timestamp'] = $article->find('lastmod', 0)->plaintext; - $item['enclosures'] = array( - $article->find('image:loc', 0)->plaintext - ); - - $fullArticle = getSimpleHTMLDOMCached($item['uri']) - or returnServerError('Error while downloading the full article'); - - $item['author'] = $fullArticle - ->find('h4[class="author-card-name"] a', 0) - ->plaintext; - $item['title'] = $fullArticle - ->find('h1[class="post-full-title"]', 0) - ->plaintext; - - $content = $fullArticle - ->find('section[class="post-full-content"]', 0); - - foreach($content->find('img') as $image) { - $image->src = $this->generateAbsoluteUrl($image->src); - } - - foreach($content->find('a') as $hyperlink) { - $hyperlink->href = $this->generateAbsoluteUrl($hyperlink->href); - } - - foreach($content->find('iframe') as $iframe) { - $iframe->outertext = $this->generateYoutubeReplacement($iframe); - } - - $item['content'] = $content->innertext; - $this->items[] = $item; - } - } - - private function generateAbsoluteUrl($path) { - if (filter_var($path, FILTER_VALIDATE_URL)) { - return $path; - } else { - return self::URI . $path; - } - } - - private function generateYoutubeReplacement($iframe) { - $embedUrl = $iframe->src; - if (parse_url($embedUrl, PHP_URL_HOST) === 'www.youtube.com') { - $urlParts = explode('/', parse_url($embedUrl, PHP_URL_PATH)); - $videoId = end($urlParts); - $thumbnailUrl = 'https://img.youtube.com/vi/' . $videoId . '/0.jpg'; - $videoUrl = 'https://www.youtube.com/watch?v=' . $videoId; - $videoReplacement = str_get_html(''); - $videoReplacement->find('a', 0)->href = $videoUrl; - $videoReplacement->find('img', 0)->src = $thumbnailUrl; - return $videoReplacement; - } - return $iframe->outertext; - } -}