mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-01 14:24:39 +03:00
[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:
parent
4cfe69abb4
commit
7783e4133d
1 changed files with 5 additions and 2 deletions
|
@ -54,7 +54,7 @@ class PicnobBridge extends BridgeAbstract
|
||||||
$relativeDate = str_replace(' ago', '', $element->find('.time', 0)->plaintext);
|
$relativeDate = str_replace(' ago', '', $element->find('.time', 0)->plaintext);
|
||||||
date_sub($date, date_interval_create_from_date_string($relativeDate));
|
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);
|
$isVideo = (bool) $element->find('.icon_video', 0);
|
||||||
$videoNote = $isVideo ? '<p><i>(video)</i></p>' : '';
|
$videoNote = $isVideo ? '<p><i>(video)</i></p>' : '';
|
||||||
|
@ -69,6 +69,8 @@ class PicnobBridge extends BridgeAbstract
|
||||||
parse_str(parse_url($imageUrl, PHP_URL_QUERY), $imageVars);
|
parse_str(parse_url($imageUrl, PHP_URL_QUERY), $imageVars);
|
||||||
$imageUrl = $imageVars['u'];
|
$imageUrl = $imageVars['u'];
|
||||||
|
|
||||||
|
$uid = explode('/', parse_url($url, PHP_URL_PATH))[2];
|
||||||
|
|
||||||
$this->items[] = [
|
$this->items[] = [
|
||||||
'uri' => $url,
|
'uri' => $url,
|
||||||
'timestamp' => date_format($date, 'r'),
|
'timestamp' => date_format($date, 'r'),
|
||||||
|
@ -83,7 +85,8 @@ class PicnobBridge extends BridgeAbstract
|
||||||
{$tvNote}
|
{$tvNote}
|
||||||
{$moreContentNote}
|
{$moreContentNote}
|
||||||
<p>{$description}<p>
|
<p>{$description}<p>
|
||||||
HTML
|
HTML,
|
||||||
|
'uid' => $uid
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue