From 6df391bcd6dc4cd03349907400d98e6445211f66 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Fri, 3 Aug 2012 14:57:22 +0200 Subject: Add base url of a site parameter for sfeedrc This allows to have a feed on a different domain but specify the base url of links if links in the feed are relative. Signed-off-by: Hiltjo Posthuma --- sfeed_update | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sfeed_update') diff --git a/sfeed_update b/sfeed_update index 52b9728..de47ed9 100755 --- a/sfeed_update +++ b/sfeed_update @@ -65,15 +65,15 @@ addfield() { } # fetch and parse feed. -# feed(name, url, encoding) +# feed(name, feedurl, basesiteurl, [encoding]) feed() { tmpfile=$(mktemp -p "$TMPDIR") - (if [ "$3" = "" ]; then + (if [ "$4" = "" ]; then # don't use iconv if encoding not set in config. - fetchfeed "$2" "$1" | sfeed | addfield "$1 $2" + fetchfeed "$2" "$1" | sfeed | addfield "$1 $2 $3" else # use iconv to convert encoding to UTF-8. - fetchfeed "$2" "$1" | iconv -cs -f "$3" -t "utf-8" | sfeed | addfield "$1 $2" + fetchfeed "$2" "$1" | iconv -cs -f "$4" -t "utf-8" | sfeed | addfield "$1 $2 $3" fi) > "$tmpfile" } -- cgit v1.2.3