summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsfeed_update6
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"