mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-13 03:54:04 +02:00
refactor: FeedExpander::parseItem() descendants (#3744)
This commit is contained in:
@@ -29,22 +29,25 @@ but some RSS readers don\'t support this. "img" tag are supported by most browse
|
||||
$this->collectExpandableDatas('https://www.phoronix.com/rss.php', $this->getInput('n'));
|
||||
}
|
||||
|
||||
protected function parseItem($newsItem)
|
||||
protected function parseItem($item)
|
||||
{
|
||||
$item = parent::parseItem($newsItem);
|
||||
// $articlePage gets the entire page's contents
|
||||
$articlePage = getSimpleHTMLDOM($newsItem->link);
|
||||
$item = parent::parseItem($item);
|
||||
|
||||
$itemUrl = $item['uri'];
|
||||
|
||||
$articlePage = getSimpleHTMLDOM($itemUrl);
|
||||
$articlePage = defaultLinkTo($articlePage, $this->getURI());
|
||||
// Extract final link. From Facebook's like plugin.
|
||||
parse_str(parse_url($articlePage->find('iframe[src^=//www.facebook.com/plugins]', 0), PHP_URL_QUERY), $facebookQuery);
|
||||
$parsedUrlQuery = parse_url($articlePage->find('iframe[src^=//www.facebook.com/plugins]', 0), PHP_URL_QUERY);
|
||||
parse_str($parsedUrlQuery, $facebookQuery);
|
||||
if (array_key_exists('href', $facebookQuery)) {
|
||||
$newsItem->link = $facebookQuery['href'];
|
||||
$itemUrl = $facebookQuery['href'];
|
||||
}
|
||||
$item['content'] = $this->extractContent($articlePage);
|
||||
|
||||
$pages = $articlePage->find('.pagination a[!title]');
|
||||
foreach ($pages as $page) {
|
||||
$pageURI = urljoin($newsItem->link, html_entity_decode($page->href));
|
||||
$pageURI = urljoin($itemUrl, html_entity_decode($page->href));
|
||||
$page = getSimpleHTMLDOM($pageURI);
|
||||
$item['content'] .= $this->extractContent($page);
|
||||
}
|
||||
|
Reference in New Issue
Block a user