mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-12 11:34:09 +02:00
fix: various small notice fixes (#3474)
* fix(patreon): php notice * fix(pepperbridge): php notice * fix(ebay): php notice * fix(tiktok): php notice * fix(yandex): fix notice * fix(justwatch): notice * lint
This commit is contained in:
@@ -84,7 +84,12 @@ class EBayBridge extends BridgeAbstract
|
||||
|
||||
$sellerInfo = $listing->find('.s-item__seller-info-text', 0)->plaintext ?? '';
|
||||
|
||||
$item['enclosures'] = [ $listing->find('.s-item__image-wrapper > img', 0)->src . '#.image' ];
|
||||
$image = $listing->find('.s-item__image-wrapper > img', 0);
|
||||
if ($image) {
|
||||
// Not quite sure why append fragment here
|
||||
$imageUrl = $image->src . '#.image';
|
||||
$item['enclosures'] = [$imageUrl];
|
||||
}
|
||||
|
||||
$item['content'] = <<<CONTENT
|
||||
<p>$sellerInfo $location</p>
|
||||
|
@@ -169,10 +169,17 @@ class JustWatchBridge extends BridgeAbstract
|
||||
foreach ($titles as $title) {
|
||||
$item = [];
|
||||
$item['uri'] = $title->find('a', 0)->href;
|
||||
$item['title'] = $provider->find('picture > img', 0)->alt . ' - ' . $title->find('.title-poster__image > img', 0)->alt;
|
||||
$image = $title->find('.title-poster__image > img', 0)->attr['src'];
|
||||
if (str_starts_with($image, 'data')) {
|
||||
$image = $title->find('.title-poster__image > img', 0)->attr['data-src'];
|
||||
|
||||
$itemTitle = sprintf(
|
||||
'%s - %s',
|
||||
$provider->find('picture > img', 0)->alt ?? '',
|
||||
$title->find('.title-poster__image > img', 0)->alt ?? ''
|
||||
);
|
||||
$item['title'] = $itemTitle;
|
||||
|
||||
$imageUrl = $title->find('.title-poster__image > img', 0)->attr['src'] ?? '';
|
||||
if (str_starts_with($imageUrl, 'data')) {
|
||||
$imageUrl = $title->find('.title-poster__image > img', 0)->attr['data-src'];
|
||||
}
|
||||
|
||||
$content = '<b>Provider:</b> '
|
||||
@@ -190,7 +197,7 @@ class JustWatchBridge extends BridgeAbstract
|
||||
$content .= '<b>Poster:</b><br><a href="'
|
||||
. $title->find('a', 0)->href
|
||||
. '"><img src="'
|
||||
. $image
|
||||
. $imageUrl
|
||||
. '"></a>';
|
||||
|
||||
$item['content'] = $content;
|
||||
|
@@ -100,12 +100,14 @@ class PatreonBridge extends BridgeAbstract
|
||||
);
|
||||
$item['author'] = $user->full_name;
|
||||
|
||||
if (isset($post->attributes->image)) {
|
||||
$item['content'] .= '<p><a href="'
|
||||
. $post->attributes->url
|
||||
. '"><img src="'
|
||||
. $post->attributes->image->thumb_url
|
||||
. '" /></a></p>';
|
||||
$image = $post->attributes->image ?? null;
|
||||
if ($image) {
|
||||
$logo = sprintf(
|
||||
'<p><a href="%s"><img src="%s" /></a></p>',
|
||||
$post->attributes->url,
|
||||
$image->thumb_url ?? $image->url ?? $this->getURI()
|
||||
);
|
||||
$item['content'] .= $logo;
|
||||
}
|
||||
|
||||
if (isset($post->attributes->content)) {
|
||||
|
@@ -129,7 +129,7 @@ class PepperBridgeAbstract extends BridgeAbstract
|
||||
|
||||
// Find the text corresponding to the clock
|
||||
$spanDateDiv = $clock->parent()->find('span[class=hide--toW3]', 0);
|
||||
$itemDate = $spanDateDiv->plaintext;
|
||||
$itemDate = $spanDateDiv->plaintext ?? '';
|
||||
// In case of a Local deal, there is no date, but we can use
|
||||
// this case for other reason (like date not in the last field)
|
||||
if ($this->contains($itemDate, $this->i8n('localdeal'))) {
|
||||
@@ -481,12 +481,12 @@ HEREDOC;
|
||||
]
|
||||
);
|
||||
if ($deal->find('span[class*=' . $selector . ']', 0) != null) {
|
||||
return '<div>'
|
||||
. $deal->find('span[class*=' . $selector . ']', 0)->children(2)->plaintext
|
||||
. '</div>';
|
||||
} else {
|
||||
return '';
|
||||
$children = $deal->find('span[class*=' . $selector . ']', 0)->children(2);
|
||||
if ($children) {
|
||||
return '<div>' . $children->plaintext . '</div>';
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -53,7 +53,13 @@ class TikTokBridge extends BridgeAbstract
|
||||
$views = $div->find('strong.video-count', 0)->plaintext;
|
||||
|
||||
$item['uri'] = $link;
|
||||
$item['title'] = $div->find('a', 1)->plaintext;
|
||||
|
||||
$a = $div->find('a', 1);
|
||||
if ($a) {
|
||||
$item['title'] = $a->plaintext;
|
||||
} else {
|
||||
$item['title'] = $this->getName();
|
||||
}
|
||||
$item['enclosures'][] = $image;
|
||||
|
||||
$item['content'] = <<<EOD
|
||||
|
@@ -39,7 +39,12 @@ class YandexZenBridge extends BridgeAbstract
|
||||
|
||||
$item['uri'] = $post->share_link;
|
||||
$item['title'] = $post->title;
|
||||
$item['timestamp'] = date(DateTimeInterface::ATOM, $post->publication_date);
|
||||
|
||||
$publicationDateUnixTimestamp = $post->publication_date ?? null;
|
||||
if ($publicationDateUnixTimestamp) {
|
||||
$item['timestamp'] = date(DateTimeInterface::ATOM, $publicationDateUnixTimestamp);
|
||||
}
|
||||
|
||||
$item['content'] = $post->text;
|
||||
$item['enclosures'] = [
|
||||
$post->image,
|
||||
|
Reference in New Issue
Block a user