From cba7d0cd41b3ab0a5101302667baeb7cc7ed3f7b Mon Sep 17 00:00:00 2001 From: ORelio Date: Sun, 4 Oct 2020 10:54:25 +0200 Subject: [PATCH] [NextINpact] Fix subtitle extraction in #LeBrief The bridge was taking another article abstract as subtitle for #LeBrief articles --- bridges/NextInpactBridge.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bridges/NextInpactBridge.php b/bridges/NextInpactBridge.php index 879141cc918..c3cca30d2c1 100644 --- a/bridges/NextInpactBridge.php +++ b/bridges/NextInpactBridge.php @@ -97,9 +97,10 @@ private function extractContent($item, $url){ return 'Failed to request NextInpact: ' . $url; // Filter premium and brief articles? + $brief_selector = 'div.brief-container'; foreach(array( 'filter_premium' => 'p.red-msg', - 'filter_brief' => 'div.brief-container' + 'filter_brief' => $brief_selector ) as $param_name => $selector) { $param_val = intval($this->getInput($param_name)); if ($param_val != 0) { @@ -119,7 +120,7 @@ private function extractContent($item, $url){ // Subtitle $subtitle = $html->find('small.subtitle', 0); - if(!is_object($subtitle)) { + if(!is_object($subtitle) && !is_object($html->find($brief_selector, 0))) { $subtitle = $html->find('small', 0); } if(!is_object($subtitle)) {