fedi-feed-router/app/Services/Parsers/VrtHomepageParserAdapter.php
myrmidex 6784af2ff6
Some checks failed
CI / ci (push) Failing after 4m31s
25 - Fix all PHPStan errors and add mockery extension
2026-03-08 14:18:28 +01:00

32 lines
699 B
PHP

<?php
namespace App\Services\Parsers;
use App\Contracts\HomepageParserInterface;
class VrtHomepageParserAdapter implements HomepageParserInterface
{
public function __construct(
private string $language = 'en',
) {}
public function canParse(string $url): bool
{
return str_contains($url, 'vrt.be');
}
public function extractArticleUrls(string $html): array
{
return VrtHomepageParser::extractArticleUrls($html, $this->language);
}
public function getHomepageUrl(): string
{
return "https://www.vrt.be/vrtnws/{$this->language}/";
}
public function getSourceName(): string
{
return 'VRT News';
}
}