mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-19 06:42:14 +02:00
refactor: FeedExpander::parseItem() descendants (#3744)
This commit is contained in:
@@ -93,21 +93,22 @@ class EconomistBridge extends FeedExpander
|
||||
$limit = 30;
|
||||
}
|
||||
|
||||
$this->collectExpandableDatas('https://www.economist.com/' . $category . '/rss.xml', $limit);
|
||||
$url = 'https://www.economist.com/' . $category . '/rss.xml';
|
||||
$this->collectExpandableDatas($url, $limit);
|
||||
}
|
||||
|
||||
protected function parseItem($feedItem)
|
||||
protected function parseItem($item)
|
||||
{
|
||||
$item = parent::parseItem($feedItem);
|
||||
$html = getSimpleHTMLDOM($item['uri']);
|
||||
$item = parent::parseItem($item);
|
||||
$dom = getSimpleHTMLDOM($item['uri']);
|
||||
|
||||
$article = $html->find('#new-article-template', 0);
|
||||
$article = $dom->find('#new-article-template', 0);
|
||||
if ($article == null) {
|
||||
$article = $html->find('main', 0);
|
||||
$article = $dom->find('main', 0);
|
||||
}
|
||||
if ($article) {
|
||||
$elem = $article->find('div', 0);
|
||||
list($content, $audio_url) = $this->processContent($html, $elem);
|
||||
list($content, $audio_url) = $this->processContent($dom, $elem);
|
||||
$item['content'] = $content;
|
||||
if ($audio_url != null) {
|
||||
$item['enclosures'] = [$audio_url];
|
||||
|
Reference in New Issue
Block a user