[NextINpact] Fix subtitle extraction in #LeBrief (#1780)

The bridge was taking another article abstract as subtitle for #LeBrief articles
This commit is contained in:
ORelio 2020-10-05 08:57:13 +02:00 committed by GitHub
parent 3df2de4c6f
commit 47dc26c775
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -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)) {