
feedfilter allows filtering an RSS feed based on a CEL expression that decides which items to include.
feedfilter [options]
-config <path>: Path to config file (default: ./config.json)-from <source>: Feed source (URL, file path, or '-' for stdin). Overrides config file.-to <destination>: Output destination (file path or '-' for stdout). Overrides config file.-version: Print version and exitfeedfilter uses a JSON configuration file to specify the feed source, output destination, filtering rules, and output format. The configuration file should contain:
{
"from": "https://example.com/feed.xml",
"to": "/path/to/output.xml",
"to_fmt": "rss",
"include_if": "title.contains('keyword') || categories.exists(c, c == 'tech')",
"meta": {
"title": "Filtered Feed",
"description": "A filtered version of the original feed",
"link": "https://example.com"
}
}
from: URL, file path, or '-' for stdin. Required unless -from flag is used.to: File path or '-' for stdout. Required unless -to flag is used.to_fmt (required): Output format - "rss", "atom", or "json"include_if (optional): CEL expression to determine which items to include. If empty, all items are included.meta (optional): Metadata for the output feed
title: Feed title (use "$$ORIG$$" to use original feed's title)description: Feed description (use "$$ORIG$$" to use original feed's description)link: Feed link URLThe include_if CEL expression has access to these variables for each feed item:
title (string): Item titledescription (string): Item descriptionlink (string): Item linkcategories (list of strings): Item categoriesbrew install cdzombak/oss/feedfilter
Install my Debian repository if you haven't already:
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://dist.cdzombak.net/keys/dist-cdzombak-net.gpg -o /etc/apt/keyrings/dist-cdzombak-net.gpg
sudo chmod 644 /etc/apt/keyrings/dist-cdzombak-net.gpg
sudo mkdir -p /etc/apt/sources.list.d
sudo curl -fsSL https://dist.cdzombak.net/cdzombak-oss.sources -o /etc/apt/sources.list.d/cdzombak-oss.sources
sudo chmod 644 /etc/apt/sources.list.d/cdzombak-oss.sources
sudo apt update
Then install feedfilter via apt-get:
sudo apt-get install feedfilter
Pre-built binaries for Linux and macOS on various architectures are downloadable from each GitHub Release. Debian packages for each release are available as well.
git clone https://github.com/cdzombak/feedfilter.git
cd feedfilter
make build
cp out/feedfilter $INSTALL_DIR
Docker images are available for a variety of Linux architectures from Docker Hub and GHCR. Images are based on the scratch image and are as small as possible.
Run them via, for example:
docker run -v ./config.json:/config.json --rm cdzombak/feedfilter:1 -config /config.json
docker run -v ./config.json:/config.json --rm ghcr.io/cdzombak/feedfilter:1 -config /config.json
# Or use flags to override config:
echo '<rss>...</rss>' | docker run -i --rm cdzombak/feedfilter:1 -from - -to - -config /config.json
GNU General Public License v3.0; see LICENSE in this repository.
This project is maintained by Chris Dzombak (dzombak.com / github.com/cdzombak).
Content type
Image
Digest
sha256:c68d2e6d0…
Size
11.4 MB
Last updated
about 1 month ago
docker pull cdzombak/feedfilter