SFEEDRC(5) | File Formats Manual | SFEEDRC(5) |
sfeedrc
—
sfeed_update(1) configuration file
sfeedrc
is the configuration file for
sfeed_update(1).
feed
()
jobs. The default is 16.feeds
()feed
(name,
feedurl, basesiteurl,
encoding)feeds
() function feeds can be defined
by calling the feed
() function, its arguments are:
According to the RSS and Atom specification feeds should always have absolute URLs, however this is not always the case in practise.
Because sfeed_update(1) is a shellscript each function can be overridden to change its behaviour, notable functions are:
fetch
(name,
url, feedfile)By default the tool curl(1) is used.
convertencoding
(name,
from, to)By default the tool iconv(1) is used.
parse
(name,
feedurl, basesiteurl)filter
(name,
url)merge
(name,
oldfile, newfile)order
(name,
url)An example configuration file is included named sfeedrc.example and also shown below:
#sfeedpath="$HOME/.sfeed/feeds" # list of feeds to fetch: feeds() { # feed <name> <feedurl> [basesiteurl] [encoding] feed "codemadness" "https://www.codemadness.org/atom_content.xml" feed "explosm" "http://feeds.feedburner.com/Explosm" feed "golang github releases" "https://github.com/golang/go/releases.atom" feed "linux kernel" "https://www.kernel.org/feeds/kdist.xml" "https://www.kernel.org" feed "reddit openbsd" "https://old.reddit.com/r/openbsd/.rss" feed "slashdot" "http://rss.slashdot.org/Slashdot/slashdot" "http://slashdot.org" feed "tweakers" "http://feeds.feedburner.com/tweakers/mixed" "http://tweakers.net" "iso-8859-1" # get youtube Atom feed: curl -s -L 'https://www.youtube.com/user/gocoding/videos' | sfeed_web | cut -f 1 feed "youtube golang" "https://www.youtube.com/feeds/videos.xml?channel_id=UCO3LEtymiLrgvpb59cNsb8A" feed "xkcd" "https://xkcd.com/atom.xml" "https://xkcd.com" }
To change the default curl(1) options for
fetching the data, the fetch
() function can be
overridden and added at the top of the sfeedrc
file:
# fetch(name, url, feedfile) fetch() { # allow for 1 redirect, set User-Agent, timeout is 15 seconds. curl -L --max-redirs 1 -H "User-Agent: 007" -f -s -m 15 \ "$2" 2>/dev/null }
Hiltjo Posthuma <hiltjo@codemadness.org>
December 26, 2023 | Debian |