From 47dc26c775a2158950cffe085c1781b6e6a71e26 Mon Sep 17 00:00:00 2001 From: ORelio Date: Mon, 5 Oct 2020 08:57:13 +0200 Subject: [PATCH] [NextINpact] Fix subtitle extraction in #LeBrief (#1780) 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 879141cc..c3cca30d 100644 --- a/bridges/NextInpactBridge.php +++ b/bridges/NextInpactBridge.php @@ -97,9 +97,10 @@ class NextInpactBridge extends FeedExpander { 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 @@ class NextInpactBridge extends FeedExpander { // 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)) {