mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-13 18:38:48 +00:00
reorder methods
This commit is contained in:
parent
95dfe1573d
commit
4269f3438a
@ -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)
|
protected function parseItem($item)
|
||||||
{
|
{
|
||||||
$item['enclosures'] = [];
|
$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)
|
public function collectExpandableDatas($url, $maxItems = -1)
|
||||||
{
|
{
|
||||||
parent::collectExpandableDatas($url, $maxItems);
|
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)
|
private function cmp($a, $b)
|
||||||
{
|
{
|
||||||
if ($a > $b) {
|
if ($a > $b) {
|
||||||
@ -261,18 +276,5 @@ class FilterMoreBridge extends FeedExpander
|
|||||||
}
|
}
|
||||||
return $url;
|
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…
Reference in New Issue
Block a user