1
0
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:
dag
2022-04-10 18:56:24 +02:00
committed by GitHub
parent 0b40f51c01
commit 5a733b3d82
13 changed files with 80 additions and 20 deletions

View File

@@ -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;
}
}