mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-03-14 20:21:14 +03:00
Added Bridge for Anisearch.de (#4023)
* Create AnisearchBridge.php * Update AnisearchBridge.php * Update AnisearchBridge.php
This commit is contained in:
parent
3ed193eee2
commit
2aace6c898
1 changed files with 54 additions and 0 deletions
54
bridges/AnisearchBridge.php
Normal file
54
bridges/AnisearchBridge.php
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
class AnisearchBridge extends BridgeAbstract
|
||||
{
|
||||
const MAINTAINER = 'Tone866';
|
||||
const NAME = 'Anisearch';
|
||||
const URI = 'https://www.anisearch.de';
|
||||
const CACHE_TIMEOUT = 1800; // 30min
|
||||
const DESCRIPTION = 'Feed for Anisearch';
|
||||
const PARAMETERS = [[
|
||||
'category' => [
|
||||
'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 . '<br />' . $content
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue