summaryrefslogtreecommitdiff
path: root/sfeedrc.5
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2021-07-06 18:23:20 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2021-07-06 18:23:20 +0200
commit15983fa731e7e62fcc19db8dd04a12007a265e8f (patch)
tree1d83589cc4b313e6021a8b6595aaf68d8149be59 /sfeedrc.5
parent303416241424af1810810073cce2f729114f68ea (diff)
sfeedrc.5: add an example how to override the options in the man page aswell
Diffstat (limited to 'sfeedrc.5')
-rw-r--r--sfeedrc.518
1 files changed, 17 insertions, 1 deletions
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 ,