[NextINpact] Fix subtitle extraction in #LeBrief (#1780)
The bridge was taking another article abstract as subtitle for #LeBrief articles
This commit is contained in:
parent
3df2de4c6f
commit
47dc26c775
1 changed files with 3 additions and 2 deletions
|
@ -97,9 +97,10 @@ class NextInpactBridge extends FeedExpander {
|
||||||
return 'Failed to request NextInpact: ' . $url;
|
return 'Failed to request NextInpact: ' . $url;
|
||||||
|
|
||||||
// Filter premium and brief articles?
|
// Filter premium and brief articles?
|
||||||
|
$brief_selector = 'div.brief-container';
|
||||||
foreach(array(
|
foreach(array(
|
||||||
'filter_premium' => 'p.red-msg',
|
'filter_premium' => 'p.red-msg',
|
||||||
'filter_brief' => 'div.brief-container'
|
'filter_brief' => $brief_selector
|
||||||
) as $param_name => $selector) {
|
) as $param_name => $selector) {
|
||||||
$param_val = intval($this->getInput($param_name));
|
$param_val = intval($this->getInput($param_name));
|
||||||
if ($param_val != 0) {
|
if ($param_val != 0) {
|
||||||
|
@ -119,7 +120,7 @@ class NextInpactBridge extends FeedExpander {
|
||||||
|
|
||||||
// Subtitle
|
// Subtitle
|
||||||
$subtitle = $html->find('small.subtitle', 0);
|
$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);
|
$subtitle = $html->find('small', 0);
|
||||||
}
|
}
|
||||||
if(!is_object($subtitle)) {
|
if(!is_object($subtitle)) {
|
||||||
|
|
Loading…
Reference in a new issue