[PicnobBridge] Update description & uid (#3267)

- Description now allows HTML and relative URLs are rewritten
- Post ID in the post URL is used as UID in the feed
This commit is contained in:
sysadminstory 2023-02-21 00:56:17 +01:00 committed by GitHub
parent 4cfe69abb4
commit 7783e4133d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,7 +54,7 @@ class PicnobBridge extends BridgeAbstract
$relativeDate = str_replace(' ago', '', $element->find('.time', 0)->plaintext);
date_sub($date, date_interval_create_from_date_string($relativeDate));
$description = trim($element->find('.sum', 0)->plaintext);
$description = defaultLinkTo(trim($element->find('.sum', 0)->innertext), self::URI);
$isVideo = (bool) $element->find('.icon_video', 0);
$videoNote = $isVideo ? '<p><i>(video)</i></p>' : '';
@ -69,6 +69,8 @@ class PicnobBridge extends BridgeAbstract
parse_str(parse_url($imageUrl, PHP_URL_QUERY), $imageVars);
$imageUrl = $imageVars['u'];
$uid = explode('/', parse_url($url, PHP_URL_PATH))[2];
$this->items[] = [
'uri' => $url,
'timestamp' => date_format($date, 'r'),
@ -83,7 +85,8 @@ class PicnobBridge extends BridgeAbstract
{$tvNote}
{$moreContentNote}
<p>{$description}<p>
HTML
HTML,
'uid' => $uid
];
}
}