Skip to content

Commit

Permalink
[MozillaSecurityBridge] Limit items to 20 (#2287)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bockiii authored Oct 9, 2021
1 parent ba5baaf commit 11be390
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bridges/MozillaSecurityBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ public function collectData(){
$articles = $html->find('div[id="main-content"] h2');

foreach ($articles as $element) {
//Limit total amount of requests
if(count($this->items) >= 20) {
break;
}
$item['title'] = $element->innertext;
$item['timestamp'] = strtotime($element->innertext);
$item['content'] = $element->next_sibling()->innertext;
Expand Down

0 comments on commit 11be390

Please sign in to comment.