28 lines
582 B
PHP
28 lines
582 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Services\Parsers;
|
||
|
|
|
||
|
|
use App\Contracts\HomepageParserInterface;
|
||
|
|
|
||
|
|
class VrtHomepageParserAdapter implements HomepageParserInterface
|
||
|
|
{
|
||
|
|
public function canParse(string $url): bool
|
||
|
|
{
|
||
|
|
return str_contains($url, 'vrt.be');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function extractArticleUrls(string $html): array
|
||
|
|
{
|
||
|
|
return VrtHomepageParser::extractArticleUrls($html);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function getHomepageUrl(): string
|
||
|
|
{
|
||
|
|
return 'https://www.vrt.be/vrtnws/en/';
|
||
|
|
}
|
||
|
|
|
||
|
|
public function getSourceName(): string
|
||
|
|
{
|
||
|
|
return 'VRT News';
|
||
|
|
}
|
||
|
|
}
|