Skip to content
René 'Necoro' Neumann edited this page May 25, 2020 · 5 revisions

Detailed Options

This page contains information about those options in the config.yml that need cannot be described in full in the config.yml.example

item-filter

item-filter allows to specify a filtering function that returns true when an item of a feed should be included. Use cases might be filtering by category or author.

The function is stated in the expr DSL (Language Definition) and gets passed an instance of a gofeed.Item (Docs which provides all the fields necessary.

NB: This filter is applied after parsing the feed and after gofeed has translated the myriads of XML tags into its simpler structure. If you really need XML content for filtering, you should write the filter script yourself and use exec instead of a URL.

Examples

  • Only get items with a certain category: "Book" in Categories
  • Only get items with a set of categories any(Categories, {# in ["Book", "Literature", "Story"]})
  • Do not get items of this weirdo author: Author.Name != "Weirdo"
  • The feed duplicates all items, do not get those where the GUID ends with "-1": !(GUID endsWith "-1") or !(GUID matches "-1$")

exec

exec allows to specify a script that generates the feed instead of specifying a URL that is fetched. Use cases include advanced feed filtering, obscure firewall setup or really generating your own feed.

exec takes an array of arguments instead of single string to avoid any parsing. Thus everything is passed exactly like specified, and also you cannot use shell constructs like pipes. If you need something like this, write a script and call that.

The executable must provide the feed content, and only it, on stdout.

Examples

  • url is boring, fetch via wget: ["wget", "https://example.com/rss", "-O", "-"]
  • Some filter script: ["./filter.sh"]

Clone this wiki locally