mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-30 14:49:53 +02:00
reorder methods
This commit is contained in:
parent
95dfe1573d
commit
4269f3438a
1 changed files with 21 additions and 19 deletions
|
@ -92,6 +92,19 @@ class FilterMoreBridge extends FeedExpander
|
|||
|
||||
]];
|
||||
|
||||
public function collectData()
|
||||
{
|
||||
if ($this->getInput('url') && substr($this->getInput('url'), 0, strlen('http')) !== 'http') {
|
||||
// just in case someone find a way to access local files by playing with the url
|
||||
returnClientError('The url parameter must either refer to http or https protocol.');
|
||||
}
|
||||
try {
|
||||
$this->collectExpandableDatas($this->getURI());
|
||||
} catch (HttpException $e) {
|
||||
$this->collectExpandableDatas($this->getURI());
|
||||
}
|
||||
}
|
||||
|
||||
protected function parseItem($item)
|
||||
{
|
||||
$item['enclosures'] = [];
|
||||
|
@ -151,12 +164,6 @@ class FilterMoreBridge extends FeedExpander
|
|||
}
|
||||
}
|
||||
|
||||
protected function sortItemKey($item)
|
||||
{
|
||||
$sort_by = $this->getInput('sort_by');
|
||||
$key = $item[$sort_by];
|
||||
return $key;
|
||||
}
|
||||
public function collectExpandableDatas($url, $maxItems = -1)
|
||||
{
|
||||
parent::collectExpandableDatas($url, $maxItems);
|
||||
|
@ -179,6 +186,14 @@ class FilterMoreBridge extends FeedExpander
|
|||
}
|
||||
}
|
||||
|
||||
protected function sortItemKey($item)
|
||||
{
|
||||
$sort_by = $this->getInput('sort_by');
|
||||
$key = $item[$sort_by];
|
||||
return $key;
|
||||
}
|
||||
|
||||
|
||||
private function cmp($a, $b)
|
||||
{
|
||||
if ($a > $b) {
|
||||
|
@ -261,18 +276,5 @@ class FilterMoreBridge extends FeedExpander
|
|||
}
|
||||
return $url;
|
||||
}
|
||||
|
||||
public function collectData()
|
||||
{
|
||||
if ($this->getInput('url') && substr($this->getInput('url'), 0, strlen('http')) !== 'http') {
|
||||
// just in case someone find a way to access local files by playing with the url
|
||||
returnClientError('The url parameter must either refer to http or https protocol.');
|
||||
}
|
||||
try {
|
||||
$this->collectExpandableDatas($this->getURI());
|
||||
} catch (HttpException $e) {
|
||||
$this->collectExpandableDatas($this->getURI());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue