mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-12-23 04:42:46 +03:00
5ab1924c4f
* 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
35 lines
874 B
PHP
35 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;
|
|
}
|
|
}
|