Skip to content

yaroslawww/laravel-external-feed-parser

Repository files navigation

Laravel external feed parser.

Packagist License Packagist Version Total Downloads Build Status Code Coverage Scrutinizer Code Quality

"Template method" package to parse external feed.

Installation

Install the package via composer:

composer require yaroslawww/laravel-external-feed-parser

Optionally you can publish the config file with:

php artisan vendor:publish --provider="ExternalFeedParser\ServiceProvider" --tag="config"

Usage

Add config to config/services.php or config/external-feed-parser.php.

'jobs-feeds' => [
    'foobar' => [
        'pull' => [
            'class'   => \ExternalFeedParser\Pull\XmlFeedPull::class,
            'options' => [
                'url'        => 'https://www.foobar.co.uk/rssfeed/example.aspx',
                'listingKey' => 'baz',
            ],
        ],
        'convert' => [
            'class'   => \ExternalFeedParser\Converters\SimpleConverter::class,
            'options' => [
                'entityClass' => \ExternalFeedParser\Entity\ExternalEntity::class,
            ],
        ],
    ],
],
FeedParser::provider('foobar')
    ->parse()
    ->each(function (ExternalEntity $entity) {
        $entity->get('baz')
    });

Credits

  • Think Studio

About

Parse external feed.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages