mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-29 06:38:51 +03:00
[Picuki] fix: item parsing (#2619)
Fixes a problem with the entire content being a link. Also truncate title. They have referrer checks on their images. So clicking the enclosure doesnt work. Will fix later.
This commit is contained in:
parent
dbee47f1d6
commit
0b40f51c01
1 changed files with 8 additions and 9 deletions
|
@ -57,19 +57,18 @@ class PicukiBridge extends BridgeAbstract
|
||||||
|
|
||||||
$item['uri'] = urljoin(self::URI, $element->find('a', 0)->href);
|
$item['uri'] = urljoin(self::URI, $element->find('a', 0)->href);
|
||||||
|
|
||||||
$item['title'] = $element->find('.photo-description', 0)->plaintext;
|
$description = trim($element->find('.photo-description', 0)->plaintext);
|
||||||
|
$item['title'] = mb_substr($description, 0, 60);
|
||||||
|
|
||||||
$is_video = (bool) $element->find('.video-icon', 0);
|
$is_video = (bool) $element->find('.video-icon', 0);
|
||||||
$item['content'] = ($is_video) ? '(video) ' : '';
|
$item['content'] = ($is_video) ? '(video) ' : '';
|
||||||
$item['content'] .= $element->find('.photo', 0)->outertext;
|
$item['content'] .= $description;
|
||||||
|
|
||||||
$item['enclosures'] = array(
|
|
||||||
// just add `.jpg` extension to get the correct mime type. All Instagram posts are JPG
|
|
||||||
urljoin(self::URI, $element->find('.post-image', 0)->src . '.jpg')
|
|
||||||
);
|
|
||||||
|
|
||||||
$item['thumbnail'] = urljoin(self::URI, $element->find('.post-image', 0)->src);
|
|
||||||
|
|
||||||
|
$postImage = $element->find('.post-image', 0)->src;
|
||||||
|
$item['enclosures'] = [
|
||||||
|
urljoin(self::URI, $postImage)
|
||||||
|
];
|
||||||
|
$item['thumbnail'] = urljoin(self::URI, $postImage);
|
||||||
$this->items[] = $item;
|
$this->items[] = $item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue