yaroslawww / laravel-external-feed-parser
Parse external feed.
1.1.0
2022-01-20 15:16 UTC
Requires
- php: ^8.0
- illuminate/support: ^8.0|^9.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.2
- guzzlehttp/guzzle: ^7.4
- mtownsend/xml-to-array: ^2.0
- orchestra/testbench: ^6.21
- phpunit/phpunit: ^9.5
- vimeo/psalm: ^4.10
Suggests
- mtownsend/xml-to-array: Required to use XmlFeedPull parser
This package is auto-updated.
Last update: 2024-12-20 21:52:29 UTC
README
"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') });