mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-02-16 07:09:54 +03:00
[CarThrottleBridge] update for new layout (#4285)
This commit is contained in:
parent
eb21e97d01
commit
3a5de759fa
1 changed files with 7 additions and 16 deletions
|
@ -80,31 +80,22 @@ class CarThrottleBridge extends BridgeAbstract
|
|||
|
||||
$item['author'] = $this->parseAuthor($articlePage);
|
||||
|
||||
$articleElement = $articlePage->find('article')[0];
|
||||
$articleImage = $articlePage->find('div.block-layout-field-image')[0];
|
||||
$article = $articlePage->find('div.block-layout-body')[1];
|
||||
|
||||
//remove ads
|
||||
foreach ($articleElement->find('aside') as $ad) {
|
||||
foreach ($article->find('aside') as $ad) {
|
||||
$ad->outertext = '';
|
||||
}
|
||||
|
||||
$summary = $articleElement->find('div.summary')[0];
|
||||
|
||||
//remove header so we are left with the article content
|
||||
foreach ($articleElement->find('header') as $found) {
|
||||
$found->outertext = '';
|
||||
}
|
||||
|
||||
//remove comments (registering on carthrottle.com is impossible so the comment sections are empty anyway)
|
||||
foreach ($articleElement->find('#lbs-comments') as $found) {
|
||||
$found->outertext = '';
|
||||
}
|
||||
$summary = $articlePage->find('div.summary')[0];
|
||||
|
||||
//these are supposed to be hidden
|
||||
foreach ($articleElement->find('.visually-hidden') as $found) {
|
||||
foreach ($article->find('.visually-hidden') as $found) {
|
||||
$found->outertext = '';
|
||||
}
|
||||
|
||||
$item['content'] = $summary . $articleElement;
|
||||
$item['content'] = $summary . $articleImage . $article;
|
||||
|
||||
array_push($this->items, $item);
|
||||
}
|
||||
|
@ -117,7 +108,7 @@ class CarThrottleBridge extends BridgeAbstract
|
|||
return '';
|
||||
}
|
||||
|
||||
$a = $authorDivs[0]->find('a');
|
||||
$a = $authorDivs[0]->find('a')[0];
|
||||
if ($a) {
|
||||
return $a->innertext;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue