From 2aace6c898c2d0f473b0a2071bf3e2d7e1f8e4d4 Mon Sep 17 00:00:00 2001 From: Tone <66808319+Tone866@users.noreply.github.com> Date: Fri, 22 Mar 2024 21:01:16 +0100 Subject: [PATCH] Added Bridge for Anisearch.de (#4023) * Create AnisearchBridge.php * Update AnisearchBridge.php * Update AnisearchBridge.php --- bridges/AnisearchBridge.php | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 bridges/AnisearchBridge.php diff --git a/bridges/AnisearchBridge.php b/bridges/AnisearchBridge.php new file mode 100644 index 00000000..639d143f --- /dev/null +++ b/bridges/AnisearchBridge.php @@ -0,0 +1,54 @@ + [ + 'name' => 'Dub', + 'type' => 'list', + 'values' => [ + 'DE' + => 'https://www.anisearch.de/anime/index/page-1?char=all&synchro=de&sort=date&order=desc&view=4', + 'EN' + => 'https://www.anisearch.de/anime/index/page-1?char=all&synchro=en&sort=date&order=desc&view=4', + 'JP' + => 'https://www.anisearch.de/anime/index/page-1?char=all&synchro=ja&sort=date&order=desc&view=4' + ] + ] + ]]; + + public function collectData() + { + $baseurl = 'https://www.anisearch.de/'; + $limit = 10; + $dom = getSimpleHTMLDOM($this->getInput('category')); + foreach ($dom->find('li.btype0') as $key => $li) { + if ($key > $limit) { + break; + } + + $a = $li->find('a', 0); + $title = $a->find('span.title', 0); + $url = $baseurl . $a->href; + + //get article + $domarticle = getSimpleHTMLDOM($url); + $content = $domarticle->find('div.details-text', 0); + + //get header-image and set absolute src + $headerimage = $domarticle->find('img#details-cover', 0); + $src = $headerimage->src; + + $this->items[] = [ + 'title' => $title->plaintext, + 'uri' => $url, + 'content' => $headerimage . '
' . $content + ]; + } + } +}