Skip to main content

Overview

revolution/laravel-fullfeed is a Laravel package that extracts the main content from web pages for feed readers.
It uses site-specific JSON rules so you can reliably pull article content from different domains.
This package was extracted from a private feed reader app and released as a standalone package.

Requirements

  • PHP >= 8.4 (uses Dom\HTMLDocument)
  • Laravel >= 12.x

Installation

If you want the latest development version:

Publish config and site rule files

This creates:
  • config/fullfeed.php
  • resources/fullfeed

Auto update site rules via composer post-update-cmd

To republish site rules automatically after composer update, add this to composer.json:

Basic usage

Testing

Use FullFeed::expects() to fake facade behavior in tests.

Site rule files

items_all.json

items_all.json is based on the LDRFullFeed (wedata) rule format used widely for full-text extraction.
Livedoor Reader, once a very popular feed reader service in Japan, has ended, but this rule data still exists and remains useful today.

plus.json

plus.json is a sample file for adding your own rules.

Rule fields

  • url: Regular expression for target URLs
  • selector: CSS selector (takes priority over xpath)
  • xpath: XPath expression
  • enc: Character encoding for non-UTF-8 pages
  • callable: Custom extractor class(es) executed before built-in extraction
  • after_callable: Custom extractor class(es) executed at the end

Extractor order as a Pipeline pattern example

FullFeed is a practical example of Laravel’s Pipeline pattern.
Extractors run in this order:
  1. Classes in callable
  2. XPathExtractor
  3. SelectorExtractor
  4. Classes in after_callable
This makes it easy to insert custom processing before and after default extraction for site-specific adjustments.

Built-in extractors

RemoveElements

Removes elements matched by selectors.

ReplaceMatches

Replaces text matched by regular expressions (processed as an HTML string).

StripTags

Removes tags using behavior equivalent to strip_tags().

Squish

Removes extra whitespace with Str::squish().

Adding custom rules

  1. Create a JSON file in resources/fullfeed
  2. Add that file to paths in config/fullfeed.php
The first matching data.url rule is used, so put custom files near the beginning of paths.
Last modified on May 28, 2026