1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-07-30 21:30:14 +02:00

fix: various small fixes (#3578)

This commit is contained in:
Dag
2023-07-29 00:14:30 +02:00
committed by GitHub
parent 11ce8b5dcd
commit 701fe3cfed
13 changed files with 87 additions and 39 deletions

View File

@@ -125,14 +125,13 @@ class AmazonPriceTrackerBridge extends BridgeAbstract
*/
private function getImage($html)
{
$image = 'https://placekitten.com/200/300';
$imageSrc = $html->find('#main-image-container img', 0);
if ($imageSrc) {
$hiresImage = $imageSrc->getAttribute('data-old-hires');
$dynamicImageAttribute = $imageSrc->getAttribute('data-a-dynamic-image');
$image = $hiresImage ?: $this->parseDynamicImage($dynamicImageAttribute);
}
$image = $image ?: 'https://placekitten.com/200/300';
return <<<EOT
<img width="300" style="max-width:300;max-height:300" src="$image" alt="{$this->title}" />