28 lines
No EOL
609 B
PHP
28 lines
No EOL
609 B
PHP
<?php
|
|
|
|
namespace App\Services\Parsers;
|
|
|
|
use App\Contracts\HomepageParserInterface;
|
|
|
|
class BelgaHomepageParserAdapter implements HomepageParserInterface
|
|
{
|
|
public function canParse(string $url): bool
|
|
{
|
|
return str_contains($url, 'belganewsagency.eu');
|
|
}
|
|
|
|
public function extractArticleUrls(string $html): array
|
|
{
|
|
return BelgaHomepageParser::extractArticleUrls($html);
|
|
}
|
|
|
|
public function getHomepageUrl(): string
|
|
{
|
|
return 'https://www.belganewsagency.eu/';
|
|
}
|
|
|
|
public function getSourceName(): string
|
|
{
|
|
return 'Belga News Agency';
|
|
}
|
|
} |