refactor: FeedExpander::parseItem() descendants (#3744)

This commit is contained in:
Dag 2023-10-13 00:25:34 +02:00 committed by GitHub
parent 9bda9e246a
commit 382648fc22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 314 additions and 281 deletions

View file

@ -12,12 +12,12 @@ class ForGifsBridge extends FeedExpander
$this->collectExpandableDatas('https://forgifs.com/gallery/srss/7');
}
protected function parseItem($feedItem)
protected function parseItem($item)
{
$item = parent::parseItem($feedItem);
$item = parent::parseItem($item);
$content = str_get_html($item['content']);
$img = $content->find('img', 0);
$dom = str_get_html($item['content']);
$img = $dom->find('img', 0);
$poster = $img->src;
// The actual gif is the same path but its id must be decremented by one.
@ -34,7 +34,7 @@ class ForGifsBridge extends FeedExpander
$img->width = 'auto';
$img->height = 'auto';
$item['content'] = $content;
$item['content'] = (string) $dom;
return $item;
}