diff options
-rw-r--r-- | README | 14 | ||||
-rwxr-xr-x | sfeed_update | 6 | ||||
-rw-r--r-- | sfeed_update.1 | 2 | ||||
-rw-r--r-- | sfeedrc.5 | 2 |
4 files changed, 10 insertions, 14 deletions
@@ -139,7 +139,7 @@ sfeedrc - Config file. This file is evaluated as a shellscript in Atleast the following functions can be overridden per feed: -- fetchfeed: to use wget(1), OpenBSD ftp(1) or an other download program. +- fetch: to use wget(1), OpenBSD ftp(1) or an other download program. - merge: to change the merge logic. - filter: to filter on fields. - order: to change the sort order. @@ -281,18 +281,14 @@ filter() { - - - -The fetchfeed function can be overridden in your sfeedrc file. This allows to +The fetch function can be overridden in your sfeedrc file. This allows to replace the default curl(1) for sfeed_update with any other client to fetch the RSS/Atom data: # fetch a feed via HTTP/HTTPS etc. -# fetchfeed(name, url, feedfile) -fetchfeed() { - if hurl -m 1048576 -t 15 "$2" 2>/dev/null; then - printf " OK %s %s\n" "$(date +'%H:%M:%S')" "$1" >&2 - else - printf "FAIL %s %s\n" "$(date +'%H:%M:%S')" "$1" >&2 - fi +# fetch(name, url, feedfile) +fetch() { + hurl -m 1048576 -t 15 "$2" 2>/dev/null } - - - diff --git a/sfeed_update b/sfeed_update index a4cc4c8..c75750a 100755 --- a/sfeed_update +++ b/sfeed_update @@ -37,8 +37,8 @@ log() { } # fetch a feed via HTTP/HTTPS etc. -# fetchfeed(name, url, feedfile) -fetchfeed() { +# fetch(name, url, feedfile) +fetch() { # fail on redirects,, hide User-Agent, timeout is 15 seconds, # -z for If-Modified-Since. curl -L --max-redirs 0 -H "User-Agent:" -f -s -m 15 \ @@ -93,7 +93,7 @@ feed() { sfeedfile="${sfeedpath}/${filename}" tmpfeedfile="${sfeedtmpdir}/${filename}" - if ! fetchfeed "${name}" "${feedurl}" "${sfeedfile}" > "${tmpfeedfile}.fetch"; then + if ! fetch "${name}" "${feedurl}" "${sfeedfile}" > "${tmpfeedfile}.fetch"; then log "${name}" "FAIL (FETCH)" return fi diff --git a/sfeed_update.1 b/sfeed_update.1 index 1366736..68bfaf1 100644 --- a/sfeed_update.1 +++ b/sfeed_update.1 @@ -32,7 +32,7 @@ This file is evaluated as a shellscript in .Pp Atleast the following functions can be overridden per feed: .Bl -tag -width 17n -.It Fn fetchfeed +.It Fn fetch to use .Xr wget 1 , OpenBSD @@ -50,7 +50,7 @@ Because is a shellscript each function can be overridden to change its behaviour, notable functions are: .Bl -tag -width Ds -.It Fn fetchfeed "name" "uri" "feedfile" +.It Fn fetch "name" "uri" "feedfile" Fetch feed from url and writes data to stdout, its arguments are: .Bl -tag -width Ds .It Fa name |