fedi-feed-router/app/Services/Parsers/BelgaHomepageParser.php
2025-07-03 21:16:57 +02:00

17 lines
No EOL
365 B
PHP

<?php
namespace App\Services\Parsers;
class BelgaHomepageParser
{
public static function extractArticleUrls(string $html): array
{
preg_match_all('/href="(https:\/\/www\.belganewsagency\.eu\/[a-z0-9-]+)"/', $html, $matches);
$urls = collect($matches[1] ?? [])
->unique()
->toArray();
return $urls;
}
}