Skip to content

Commit

Permalink
limit the number of images that are being fetched per feed item
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaishiyoku committed Oct 13, 2024
1 parent 679fa66 commit a1c2770
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public static function getImageUrlsForFeedItem(string $feedItemUrl, ?string $con
// don't allow GIF images because those will most likely be tracking pixels
return self::filterImageUrls(
(new Collection($imageUrls))
->take(3) // limit the number of images
->map(fn (string $imageUrl) => Str::startsWith($imageUrl, 'http') ? $imageUrl : $baseUrl.'/'.ltrim($imageUrl, '/')),
$httpClient
)
Expand Down

0 comments on commit a1c2770

Please sign in to comment.