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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user