1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-16 21:44:01 +02:00

refactor: FeedExpander::parseItem() descendants (#3744)

This commit is contained in:
Dag
2023-10-13 00:25:34 +02:00
committed by GitHub
parent 9bda9e246a
commit 382648fc22
46 changed files with 314 additions and 281 deletions

View File

@@ -30,14 +30,17 @@ class TapasBridge extends FeedExpander
protected $id;
public function getURI()
public function collectData()
{
if ($this->id) {
return self::URI . 'rss/series/' . $this->id;
} else {
return self::URI . 'series/' . $this->getInput('title') . '/info/';
if (preg_match('/^[\d]+$/', $this->getInput('title'))) {
$this->id = $this->getInput('title');
}
return self::URI;
if ($this->getInput('force_title') or !$this->id) {
$html = getSimpleHTMLDOM($this->getURI()) or returnServerError('Could not request ' . $this->getURI());
$this->id = $html->find('meta[property$=":url"]', 0)->content;
$this->id = str_ireplace(['tapastic://series/', '/info'], '', $this->id);
}
$this->collectExpandableDatas($this->getURI());
}
protected function parseItem($feedItem)
@@ -72,16 +75,13 @@ class TapasBridge extends FeedExpander
return $item;
}
public function collectData()
public function getURI()
{
if (preg_match('/^[\d]+$/', $this->getInput('title'))) {
$this->id = $this->getInput('title');
if ($this->id) {
return self::URI . 'rss/series/' . $this->id;
} else {
return self::URI . 'series/' . $this->getInput('title') . '/info/';
}
if ($this->getInput('force_title') or !$this->id) {
$html = getSimpleHTMLDOM($this->getURI()) or returnServerError('Could not request ' . $this->getURI());
$this->id = $html->find('meta[property$=":url"]', 0)->content;
$this->id = str_ireplace(['tapastic://series/', '/info'], '', $this->id);
}
$this->collectExpandableDatas($this->getURI());
return self::URI;
}
}