Looking to hire Laravel developers? Try LaraJobs

laravel-external-feed-parser maintained by yaroslawww

Description
Parse external feed.
Last update
2022/01/20 16:16 (dev-master)
License
Downloads
11
Tags

Comments
comments powered by Disqus

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