diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2018-02-18 14:40:41 +0100 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2018-02-18 14:40:41 +0100 |
commit | 08b5e6ab3a4de0ff30743fa9c348724c11c55b74 (patch) | |
tree | ddee975dd37bd8b82bd6f2b1b383aaaf8bb32ad7 /sfeed_update | |
parent | 1a26a00bcd96911f602d2d2ff6990934e45decb0 (diff) |
sfeed_update: use filename as feedname again
make the feedname sanitization less strict again.
Diffstat (limited to 'sfeed_update')
-rwxr-xr-x | sfeed_update | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sfeed_update b/sfeed_update index db0ceca..2977bdc 100755 --- a/sfeed_update +++ b/sfeed_update @@ -67,13 +67,14 @@ convertencoding() { # feed(name, feedurl, [basesiteurl], [encoding]) feed() { (name="$1" - filename="$(printf '%s' "$1" | sed -E 's@[^a-zA-Z0-9]+@_@g')" + filename="$(printf '%s' "$1" | tr '/' '_')" feedurl="$2" basesiteurl="$3" tmpfeedfile="${sfeedtmpdir}/${filename}" tmpencfile="" encoding="$4" sfeedfile="${sfeedpath}/${filename}" + if [ ! "${encoding}" = "" ]; then fetchfeed "${feedurl}" "${name}" "${sfeedfile}" | \ convertencoding "${encoding}" "utf-8" @@ -82,8 +83,7 @@ feed() { fetchfeed "${feedurl}" "${name}" "${sfeedfile}" > "${tmpencfile}" detectenc=$(sfeed_xmlenc < "${tmpencfile}") convertencoding "${detectenc}" "utf-8" < "${tmpencfile}" - fi | sfeed "${basesiteurl}" | \ - awk -v "n=${name}" '{ print $0 " " n }' > "${tmpfeedfile}" + fi | sfeed "${basesiteurl}" > "${tmpfeedfile}" # get new data and merge with old. sfeedfilenew="${sfeedpath}/${filename}.new" |