From 976fdc86ae71803a5ab3c79205d60a967a12513a Mon Sep 17 00:00:00 2001 From: IceWreck Date: Tue, 1 Oct 2019 23:31:39 +0530 Subject: [PATCH 1/3] [VarietyBridge] - add new bridge --- bridges/VarietyBridge.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 bridges/VarietyBridge.php diff --git a/bridges/VarietyBridge.php b/bridges/VarietyBridge.php new file mode 100644 index 00000000000..b8b7ad99d8c --- /dev/null +++ b/bridges/VarietyBridge.php @@ -0,0 +1,25 @@ +collectExpandableDatas('http://feeds.feedburner.com/variety/headlines', 15); + } + + protected function parseItem($newsItem){ + $item = parent::parseItem($newsItem); + // $articlePage gets the entire page's contents + $articlePage = getSimpleHTMLDOM($newsItem->link); + $article = $articlePage->find('div.c-featured-media', 0); + $article =$article . $articlePage->find('.c-content', 0); + $item['content'] = $article; + // I've left the script tags alone because some feed readers support them, + // even tho they look ugly in rssbridge's html view + return $item; + } +} From 96a74eace03ec12df5c320c5cc0d18f9476c4d50 Mon Sep 17 00:00:00 2001 From: IceWreck Date: Wed, 2 Oct 2019 00:37:42 +0530 Subject: [PATCH 2/3] Fix formatting to remove travisci errors --- bridges/VarietyBridge.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bridges/VarietyBridge.php b/bridges/VarietyBridge.php index b8b7ad99d8c..f98822d5162 100644 --- a/bridges/VarietyBridge.php +++ b/bridges/VarietyBridge.php @@ -15,11 +15,11 @@ protected function parseItem($newsItem){ $item = parent::parseItem($newsItem); // $articlePage gets the entire page's contents $articlePage = getSimpleHTMLDOM($newsItem->link); - $article = $articlePage->find('div.c-featured-media', 0); - $article =$article . $articlePage->find('.c-content', 0); - $item['content'] = $article; - // I've left the script tags alone because some feed readers support them, - // even tho they look ugly in rssbridge's html view - return $item; + $article = $articlePage->find('div.c-featured-media', 0); + $article = $article . $articlePage->find('.c-content', 0); + $item['content'] = $article; + // I've left the script tags alone because some feed readers support them, + // even tho they look ugly in rssbridge's html view + return $item; } } From 78cfed6e69e35372af17cc64c75ddafcb4a9db35 Mon Sep 17 00:00:00 2001 From: Anchit Date: Fri, 1 Nov 2019 13:01:32 +0530 Subject: [PATCH 3/3] remove script tags --- bridges/VarietyBridge.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bridges/VarietyBridge.php b/bridges/VarietyBridge.php index f98822d5162..a2e617009aa 100644 --- a/bridges/VarietyBridge.php +++ b/bridges/VarietyBridge.php @@ -15,11 +15,16 @@ protected function parseItem($newsItem){ $item = parent::parseItem($newsItem); // $articlePage gets the entire page's contents $articlePage = getSimpleHTMLDOM($newsItem->link); + + // Remove Script tags + foreach($articlePage->find('script') as $script_tag) { + $script_tag->remove(); + } $article = $articlePage->find('div.c-featured-media', 0); $article = $article . $articlePage->find('.c-content', 0); + $item['content'] = $article; - // I've left the script tags alone because some feed readers support them, - // even tho they look ugly in rssbridge's html view + return $item; } }