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
|
@ -7,11 +7,18 @@ class PcGamerBridge extends BridgeAbstract
|
|||
updates and news on all your favorite PC gaming franchises.';
|
||||
const MAINTAINER = 'IceWreck, mdemoss';
|
||||
|
||||
const PARAMETERS = [
|
||||
[
|
||||
'limit' => self::LIMIT,
|
||||
]
|
||||
];
|
||||
|
||||
public function collectData()
|
||||
{
|
||||
$html = getSimpleHTMLDOMCached($this->getURI(), 300);
|
||||
$stories = $html->find('a.article-link');
|
||||
foreach ($stories as $element) {
|
||||
$limit = $this->getInput('limit') ?? 10;
|
||||
foreach (array_slice($stories, 0, $limit) as $element) {
|
||||
$item = array();
|
||||
$item['uri'] = $element->href;
|
||||
$articleHtml = getSimpleHTMLDOMCached($item['uri']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue