From 15983fa731e7e62fcc19db8dd04a12007a265e8f Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Tue, 6 Jul 2021 18:23:20 +0200 Subject: sfeedrc.5: add an example how to override the options in the man page aswell --- sfeedrc.5 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/sfeedrc.5 b/sfeedrc.5 index fe55f4d..022e696 100644 --- 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 , -- cgit v1.2.3