Skip to content

Commit

Permalink
[NextINpact] Fix subtitle extraction in #LeBrief (#1780)
Browse files Browse the repository at this point in the history
The bridge was taking another article abstract as subtitle for #LeBrief articles
  • Loading branch information
ORelio authored Oct 5, 2020
1 parent 3df2de4 commit 47dc26c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bridges/NextInpactBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)) {
Expand Down

0 comments on commit 47dc26c

Please sign in to comment.