0
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2024-11-23 07:37:35 +00:00
RSS-Bridge_rss-bridge/bridges/OglafBridge.php
tillcash 5ab1924c4f
Add WorldbankBridge and OglafBridge (#3862)
* Add WorldbankBridge and OglafBridge

* Update OglafBridge.php

Remove redundant parent call to parseItem and rename formal argument to improve code clarity.

* Update WorldbankBridge.php

fix lint
2023-12-28 13:50:34 +01:00

36 lines
874 B
PHP

<?php
class OglafBridge extends FeedExpander
{
const NAME = 'Oglaf';
const URI = 'https://www.oglaf.com/';
const DESCRIPTION = 'Fetch the entire comic image';
const MAINTAINER = 'tillcash';
const PARAMETERS = [
[
'limit' => [
'name' => 'limit (max 20)',
'type' => 'number',
'defaultValue' => 10,
'required' => true,
]
]
];
public function collectData()
{
$url = self::URI . 'feeds/rss/';
$limit = min(20, $this->getInput('limit'));
$this->collectExpandableDatas($url, $limit);
}
protected function parseItem($item)
{
$html = getSimpleHTMLDOMCached($item['uri']);
$comicImage = $html->find('img[id="strip"]', 0);
$item['content'] = $comicImage;
return $item;
}
}