sfeed

Simple RSS and Atom feed parser
git clone https://git.sinitax.com/codemadness/sfeed
Log | Files | Refs | README | LICENSE | Upstream | sfeed.txt

commit 15983fa731e7e62fcc19db8dd04a12007a265e8f
parent 303416241424af1810810073cce2f729114f68ea
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Tue,  6 Jul 2021 18:23:20 +0200

sfeedrc.5: add an example how to override the options in the man page aswell

Diffstat:
Msfeedrc.5 | 18+++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/sfeedrc.5 b/sfeedrc.5 @@ -1,4 +1,4 @@ -.Dd January 26, 2021 +.Dd July 6, 2021 .Dt SFEEDRC 5 .Os .Sh NAME @@ -147,6 +147,22 @@ feeds() { feed "xkcd" "https://xkcd.com/atom.xml" "https://xkcd.com" } .Ed +.Pp +To change the default +.Xr curl 1 +options for fetching the data, the +.Fn fetch +function can be overridden and added at the top of the +.Nm +file: +.Bd -literal +# fetch(name, url, feedfile) +fetch() { + # allow for 1 redirect, hide User-Agent, timeout is 15 seconds. + curl -L --max-redirs 1 -H "User-Agent:" -f -s -m 15 \\ + "$2" 2>/dev/null +} +.Ed .Sh SEE ALSO .Xr curl 1 , .Xr iconv 1 ,