<?php

use App\Services\Parsers\BelgaArticlePageParser;
use App\Services\Parsers\BelgaArticleParser;
use App\Services\Parsers\BelgaHomepageParserAdapter;
use App\Services\Parsers\GuardianArticlePageParser;
use App\Services\Parsers\GuardianArticleParser;
use App\Services\Parsers\VrtArticlePageParser;
use App\Services\Parsers\VrtArticleParser;
use App\Services\Parsers\VrtHomepageParserAdapter;

return [
    /*
    |--------------------------------------------------------------------------
    | Feed Providers
    |--------------------------------------------------------------------------
    |
    | This array contains the configuration for available feed providers.
    | Each provider should have a unique code, display name, description,
    | type (website or rss), and active status.
    |
    */

    'providers' => [
        'vrt' => [
            'code' => 'vrt',
            'name' => 'VRT News',
            'description' => 'Belgian public broadcaster news',
            'type' => 'website',
            'is_active' => true,
            'languages' => [
                'en' => ['url' => 'https://www.vrt.be/vrtnws/en/'],
                'nl' => ['url' => 'https://www.vrt.be/vrtnws/nl/'],
            ],
            'parsers' => [
                'homepage' => VrtHomepageParserAdapter::class,
                'article' => VrtArticleParser::class,
                'article_page' => VrtArticlePageParser::class,
            ],
        ],
        'belga' => [
            'code' => 'belga',
            'name' => 'Belga News Agency',
            'description' => 'Belgian national news agency',
            'type' => 'website',
            'is_active' => true,
            'languages' => [
                // offset is a 0-based item index; offset=1 skips the newest release (#158).
                'en' => ['url' => 'https://capi.belga.press/belgapress/api/public/pressreleases?offset=0&count=50&search=&start=&end=&newsroomId=70&language=EN'],
            ],
            'parsers' => [
                'homepage' => BelgaHomepageParserAdapter::class,
                'article' => BelgaArticleParser::class,
                'article_page' => BelgaArticlePageParser::class,
            ],
        ],
        'guardian' => [
            'code' => 'guardian',
            'name' => 'The Guardian',
            'description' => 'British daily newspaper',
            'type' => 'rss',
            'is_active' => true,
            'languages' => [
                'en' => ['url' => 'https://www.theguardian.com/international/rss'],
            ],
            'parsers' => [
                'article' => GuardianArticleParser::class,
                'article_page' => GuardianArticlePageParser::class,
            ],
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Default Feed Settings
    |--------------------------------------------------------------------------
    |
    | Default configuration values for feed processing
    |
    */

    'defaults' => [
        'fetch_interval' => 3600, // 1 hour in seconds
        'max_articles_per_fetch' => 50,
        'article_retention_days' => 30,
    ],
];
