PHPackages                             kaishiyoku/hera-rss-crawler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. kaishiyoku/hera-rss-crawler

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

kaishiyoku/hera-rss-crawler
===========================

Modern library to handle RSS/Atom feeds

8.0.0(1mo ago)24.5k1[1 issues](https://github.com/Kaishiyoku/hera-rss-crawler/issues)MITPHPPHP ^8.3CI failing

Since Dec 23Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Kaishiyoku/hera-rss-crawler)[ Packagist](https://packagist.org/packages/kaishiyoku/hera-rss-crawler)[ Docs](https://github.com/kaishiyoku/hera-rss-crawler)[ GitHub Sponsors](https://github.com/kaishiyoku)[ RSS](/packages/kaishiyoku-hera-rss-crawler/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (32)Versions (60)Used By (0)

About
=====

[](#about)

This project tries to make fetching and parsing RSS feeds easier. With Hera RSS you can discover, fetch and parse RSS feeds.

Installation
============

[](#installation)

1. simply run `composer require kaishiyoku/hera-rss-crawler`
2. create a new crawler instance using `$heraRssCrawler = new HeraRssCrawler()`
3. discover a feed, for example `$feedUrls = $heraRssCrawler->discoverFeedUrls('https://laravel-news.com/')`
4. pick the feed you like to use; if there were multiple feeds discovered pick one
5. fetch the feed: `$feed = $heraRssCrawler->parseFeed($feedUrls->get(0))`
6. fetch the articles: `$feedItems = $feed->getFeedItems()`

Breaking Changes
================

[](#breaking-changes)

Version 6.x
-----------

[](#version-6x)

- dropped support for PHP 8.0

Version 5.x
-----------

[](#version-5x)

- dropped support for PHP 7.4

Version 4.x
-----------

[](#version-4x)

- dropped support for Laravel 8

Version 3.x
-----------

[](#version-3x)

- FeedItem-method `jsonSerialize` has been renamed to `toJson` and doesn't return `null` anymore but throws a `JsonException` if the serialized JSON is invalid.

Available crawler options
=========================

[](#available-crawler-options)

```
setRetryCount(int $retryCount): void
```

Determines how many retries parsing or discovering feeds will be made when an exception occurs, e.g. if the feed was unreachable.

```
setLogger(LoggerInterface $logger): void
```

Set your own logger instance, e.g. a simple file logger.

```
setUrlReplacementMap(array $urlReplacementMap): void
```

Useful for websites which redirect to another subdomain when visiting the site, e.g. for Reddit.

```
setFeedDiscoverers(Collection $feedDiscoverers): void
```

With that you can set your own feed discoverers.

You can even write your own, just make sure to implement the `FeedDiscoverer` interface:

```
