diff options
author | 2022-07-08 18:42:45 +0200 | |
---|---|---|
committer | 2022-07-08 18:42:45 +0200 | |
commit | c992bcc8bf0a5abbc9ea897acc7d98520763313d (patch) | |
tree | 705bc82452a33d0ecb288067413fe8cd2fed2da8 | |
parent | f672902896e71db8f6f06c557be6f701e31b6e7a (diff) | |
download | rss-bridge-c992bcc8bf0a5abbc9ea897acc7d98520763313d.tar.gz rss-bridge-c992bcc8bf0a5abbc9ea897acc7d98520763313d.tar.zst rss-bridge-c992bcc8bf0a5abbc9ea897acc7d98520763313d.zip |
[AssociatedPressNews] fix: prepend lead photo to items (#2905)
-rw-r--r-- | bridges/AssociatedPressNewsBridge.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bridges/AssociatedPressNewsBridge.php b/bridges/AssociatedPressNewsBridge.php index 6d686312..0f8846eb 100644 --- a/bridges/AssociatedPressNewsBridge.php +++ b/bridges/AssociatedPressNewsBridge.php @@ -149,8 +149,11 @@ class AssociatedPressNewsBridge extends BridgeAbstract $this->processIframes($html); if (!is_null($storyContent['leadPhotoId'])) { - $item['enclosures'][] = 'https://storage.googleapis.com/afs-prod/media/' - . $storyContent['leadPhotoId'] . '/800.jpeg'; + $leadPhotoUrl = sprintf('https://storage.googleapis.com/afs-prod/media/%s/800.jpeg', $storyContent['leadPhotoId']); + $leadPhotoImageTag = sprintf('<img src="%s">', $leadPhotoUrl); + // Move the image to the beginning of the content + $html = $leadPhotoImageTag . $html; + // Explicitly not adding it to the item's enclosures! } } |