mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-16 05:24:08 +02:00
* [CssSelectorBridge] Metadata from social embed (#3602, #3687) Implement the following metadata sources: - Facebook Open Graph - Twitter <meta> tags - Standard <meta> tags - JSON linked data (ld+json) The following metadata is supported: - Canonical URL (may help removing garbage from URLs) - Article title - Truncated summary - Published/Updated timestamp - Enclosure/Thumbnail image - Author Name or Twitter handle SitemapBridge will also automatically benefit from this commit. * [php8backports] Add array_is_list() Needed this function for ld+json implementation in CssSelectorBridge. * [SitemapBridge] Add option to discard thumbnail * [CssSelectorBridge] Fix linting issues
This commit is contained in:
@@ -53,6 +53,11 @@ class SitemapBridge extends CssSelectorBridge
|
||||
EOT,
|
||||
'exampleValue' => 'https://example.com/sitemap.xml',
|
||||
],
|
||||
'discard_thumbnail' => [
|
||||
'name' => '[Optional] Discard thumbnail set by site author',
|
||||
'title' => 'Some sites set their logo as thumbnail for every article. Use this option to discard it.',
|
||||
'type' => 'checkbox',
|
||||
],
|
||||
'limit' => self::LIMIT
|
||||
]
|
||||
];
|
||||
@@ -65,6 +70,7 @@ class SitemapBridge extends CssSelectorBridge
|
||||
$content_cleanup = $this->getInput('content_cleanup');
|
||||
$title_cleanup = $this->getInput('title_cleanup');
|
||||
$site_map = $this->getInput('site_map');
|
||||
$discard_thumbnail = $this->getInput('discard_thumbnail');
|
||||
$limit = $this->getInput('limit');
|
||||
|
||||
$this->feedName = $this->getPageTitle($url, $title_cleanup);
|
||||
@@ -77,7 +83,11 @@ class SitemapBridge extends CssSelectorBridge
|
||||
}
|
||||
|
||||
foreach ($links as $link) {
|
||||
$this->items[] = $this->expandEntryWithSelector($link, $content_selector, $content_cleanup, $title_cleanup);
|
||||
$item = $this->expandEntryWithSelector($link, $content_selector, $content_cleanup, $title_cleanup);
|
||||
if ($discard_thumbnail && isset($item['enclosures'])) {
|
||||
unset($item['enclosures']);
|
||||
}
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user