From 79f14611dc8f3fe4f33839961e2cfb59e5a01987 Mon Sep 17 00:00:00 2001 From: ORelio Date: Tue, 10 Oct 2023 17:41:26 +0200 Subject: [PATCH] [WeLiveSecurity] Fix content extraction --- bridges/WeLiveSecurityBridge.php | 35 ++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/bridges/WeLiveSecurityBridge.php b/bridges/WeLiveSecurityBridge.php index 6434a13a9c2..f54f6b29098 100644 --- a/bridges/WeLiveSecurityBridge.php +++ b/bridges/WeLiveSecurityBridge.php @@ -16,19 +16,36 @@ protected function parseItem($item) { $item = parent::parseItem($item); - $article_html = getSimpleHTMLDOMCached($item['uri']); - if (!$article_html) { - $item['content'] .= '

Could not request ' . $this->getName() . ': ' . $item['uri'] . '

'; + $html = getSimpleHTMLDOMCached($item['uri']); + if (!$html) { + $item['content'] .= '

Could not request ' . $this->getName() . ': ' . $item['uri'] . '

'; return $item; } - $article_content = $article_html->find('div.formatted', 0)->innertext; - $article_content = stripWithDelimiters($article_content, ''); - $article_content = stripRecursiveHTMLSection($article_content, 'div', '