SimplePie is a popular and feature-rich PHP library for parsing RSS/Atom feeds, but I don't particularly like the API. This package is just a lightweight wrapper around SimplePie that provides a slightly different API along with Laravel support.
You can install the package via composer:
composer require teamzac/larapie
$feed = LaraPie::feed('https://your-feed-url/here.rss')->get();
$feed->items()->each(function($item) {
echo $item->title;
});
The primary data types are Feed and Item.
The Feed class represents the RSS feed. It has an items()
method which returns an Illuminate\Support\Collection
instance of the feed items (TeamZac\LaraPie\Item
). The Feed has the following read-only properties:
- title
- type
- links (
TeamZac\LaraPie\Links
)
The Item class represents a single feed item. It has the following read-only properties:
- id - usually the URL
- title
- description
- content
- categories (
Illuminate\Support\Collection
of strings) - authors (
Illuminate\Support\Collection
ofTeamZac\LaraPie\Author
) - dates (
Illuminate\Support\Collection
ofCarbon\Carbon
) - links (
Illuminate\Support\Collection
of strings)
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email chad@zactax.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.