summaryrefslogtreecommitdiff
path: root/sfeed_update
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2012-08-03 14:57:22 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2012-08-03 14:57:22 +0200
commit6df391bcd6dc4cd03349907400d98e6445211f66 (patch)
tree156aef84f463ece9d723c60ccc13de826d226974 /sfeed_update
parentdb5ffcaa8c133d249aafa4a64f3d827dd513d995 (diff)
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 <hiltjo@codemadness.org>
Diffstat (limited to 'sfeed_update')
-rwxr-xr-xsfeed_update8
1 files changed, 4 insertions, 4 deletions
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"
}