Feedfry is free with ads or paid subscription. I paid while house shopping but
let that lapse afterwards. I don't begrudge them funding the service with ads or
subscriptions but I figured I could probably put something together and
self-host it. At the same time providing a bit more control over how the
elements of the page were extracted to generate the feed. [RSS Please][rsspls]
is the result.
RSS Please is an open-source command line application implemented in Rust. It
has no runtime dependencies and runs on UNIX-like platforms including FreeBSD,
Linux, and macOS. Once I resolve [this issue][windows-issue] it will run on
Windows too. The following sections describe how it's configured and how I'm
running it on my server.
### Configuration
The `rsspls` configuration file allows a number of feeds to be defined. It
uses [CSS Selectors][css] to describe how parts of each page will be extracted
to produce a feed. As an example here's a configuration that builds a feed
from this site—although I already have an RSS feed at
<https://www.wezm.net/v2/rss.xml> if you want to subscribe.
```toml
# The configuration must start with the [rsspls] section
[rsspls]
output = "/tmp"
[[feed]]
# The title of the channel in the feed
title = "Example WezM.net Feed"
# The output filename within the output directory to write this feed to.
filename = "wezm.rss"
[feed.config]
url = "https://www.wezm.net/"
item = "article"
heading = "h3 a"
summary = ".post-body"
date = "time"
```
The configuration format is [TOML]. The `item` key selects `article` elements
from the page. `heading`, `summary`, and `date` are selectors upon the element
selected by `item`. `summary` and `date` are optional. `heading` is expected to
select an element with a `href` attribute, which is used as the link for the
item in the feed.
### Running It
Once installed running `rsspls` will update the configured feeds. Caching is
used to skip updates when the origin server indicates nothing has changed since
last time. By default `rsspls` looks for its configuration file in
`$XDG_CONFIG_HOME/rsspls/feeds.toml`, defaulting to
`~/.config/rsspls/feeds.toml` if `XDG_CONFIG_HOME` is not set. Alternatively
the path can be supplied with `--config`.
{{ figure(image="posts/2022/generate-rss-from-webpage/rsspls-output.png", link="posts/2022/generate-rss-from-webpage/rsspls-output.png", alt="Screenshot of the output when running rsspls. It has several log messages prefixed with INFO describing the actions taken", caption="rsspls prints informational messages when updating feeds", width=335, border=false) }}
### Deployment
Since I
[host my things with Docker + Compose](@/posts/2022/alpine-linux-docker-infrastructure-three-years/index.md)
I'm running `rsspls` with Docker as well, but that's not required. There are
plenty of other ways you could go about it. E.g. you could have `cron` run
`rsspls` on your computer and `rsync` the feeds to a server. Some RSS aggregators
like [Liferea] even let you subscribe to local files.
I create a Docker image from the `rsspls` binaries I publish:
```dockerfile
FROM wezm-alpine:3.16.0
# UID needs to match owner of /home/rsspls/feeds volume