<?php

namespace App\Services\Parsers;

use App\Contracts\ArticleParserInterface;

class GuardianArticleParser implements ArticleParserInterface
{
    public function canParse(string $url): bool
    {
        return str_contains($url, 'theguardian.com');
    }

    public function extractData(string $html): array
    {
        return GuardianArticlePageParser::extractData($html);
    }

    public function getSourceName(): string
    {
        return 'The Guardian';
    }
}
