1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-05 08:07:33 +02:00

[CssSelectorBridge] Retrieve metadata for social media embeds (#3602, #3687) (#3706)

* [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:
ORelio
2023-09-24 23:07:43 +02:00
committed by GitHub
parent 09f3c1532a
commit e1b911fc1f
3 changed files with 290 additions and 15 deletions

View File

@@ -54,3 +54,13 @@ if (!function_exists('str_contains')) {
return $needle !== '' && mb_strpos($haystack, $needle) !== false;
}
}
if (!function_exists('array_is_list')) {
function array_is_list(array $arr)
{
if ($arr === []) {
return true;
}
return array_keys($arr) === range(0, count($arr) - 1);
}
}