mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 10:04:54 +02:00
feat: add limit options to the slowest bridges
This commit is contained in:
parent
0b40f51c01
commit
5a733b3d82
13 changed files with 80 additions and 20 deletions
|
@ -32,6 +32,7 @@ class GQMagazineBridge extends BridgeAbstract
|
|||
'required' => true,
|
||||
'exampleValue' => 'sexe/news'
|
||||
),
|
||||
'limit' => self::LIMIT,
|
||||
));
|
||||
|
||||
const REPLACED_ATTRIBUTES = array(
|
||||
|
@ -76,7 +77,12 @@ class GQMagazineBridge extends BridgeAbstract
|
|||
|
||||
// Since GQ don't want simple class scrapping, let's do it the hard way and ... discover content !
|
||||
$main = $html->find('main', 0);
|
||||
$limit = $this->getInput('limit') ?? 10;
|
||||
foreach ($main->find('a') as $link) {
|
||||
if (count($this->items) >= $limit) {
|
||||
break;
|
||||
}
|
||||
|
||||
$uri = $link->href;
|
||||
$date = $link->parent()->find('time', 0);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue