mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-31 22:00:23 +02:00
feat: add limit options to the slowest bridges
This commit is contained in:
@@ -23,7 +23,8 @@ class InternetArchiveBridge extends BridgeAbstract {
|
||||
'Web Archives' => 'web-archive',
|
||||
),
|
||||
'defaultValue' => 'uploads',
|
||||
)
|
||||
),
|
||||
'limit' => self::LIMIT,
|
||||
)
|
||||
);
|
||||
|
||||
@@ -72,7 +73,8 @@ class InternetArchiveBridge extends BridgeAbstract {
|
||||
if ($this->getInput('content') !== 'posts') {
|
||||
$detailsDivNumber = 0;
|
||||
|
||||
foreach ($html->find('div.results > div[data-id]') as $index => $result) {
|
||||
$results = $html->find('div.results > div[data-id]');
|
||||
foreach ($results as $index => $result) {
|
||||
$item = array();
|
||||
|
||||
if (in_array($result->class, $this->skipClasses)) {
|
||||
@@ -110,6 +112,11 @@ class InternetArchiveBridge extends BridgeAbstract {
|
||||
}
|
||||
|
||||
$detailsDivNumber++;
|
||||
|
||||
$limit = $this->getInput('limit') ?? 10;
|
||||
if (count($this->items) >= $limit) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,7 +309,7 @@ EOD;
|
||||
|
||||
$items[] = $item;
|
||||
|
||||
if (count($items) >= 10) {
|
||||
if (count($items) >= $this->getInput('limit') ?? 10) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user