From 523b556139a6b237a6dd6aed014046fa09b8c5b3 Mon Sep 17 00:00:00 2001 From: Aleksei Besogonov Date: Sat, 16 Nov 2024 17:27:33 -0800 Subject: [PATCH] [ScarletComicBridge] Add Scarlet Comic bridge This bridge allows retreival of full comic pages from the RSS feed. The comic is licensed under CC BY-NC-ND 4.0. --- bridges/ScarletComicBridge.php | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 bridges/ScarletComicBridge.php diff --git a/bridges/ScarletComicBridge.php b/bridges/ScarletComicBridge.php new file mode 100755 index 00000000000..eba0fcb5864 --- /dev/null +++ b/bridges/ScarletComicBridge.php @@ -0,0 +1,35 @@ + [ + 'name' => 'limit (max 5)', + 'type' => 'number', + 'defaultValue' => 5, + 'required' => true, + ] + ] + ]; + + public function collectData() + { + $url = self::URI . '/scarlet/feed'; + $limit = min(5, $this->getInput('limit')); + $this->collectExpandableDatas($url, $limit); + } + + protected function parseItem($item) + { + $html = getSimpleHTMLDOMCached($item['uri']); + $comicImage = $html->find('div[id="spliced-comic"]', 0); + $item['content'] = $comicImage; + + return $item; + } +}