sfeed

Simple RSS and Atom feed parser
git clone https://git.sinitax.com/codemadness/sfeed
Log | Files | Refs | README | LICENSE | Upstream | sfeed.txt

commit 1fe61cfcf216d459173724805f37ad6e4eff4920
parent 9b2038f63b9942640dfd174bb922eec4c848ccbc
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Sun,  4 Jan 2015 23:45:51 +0100

sfeed_update: style

Diffstat:
Msfeed_update | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/sfeed_update b/sfeed_update @@ -54,10 +54,12 @@ fetchfeed() { # convert encoding from one encoding to another. # convertencoding(from, to) convertencoding() { - if [ ! "$1" = "" ] && [ ! "$2" = "" ] && [ ! "$1" = "$2" ]; then # from != to + # if from != to + if [ ! "$1" = "" ] && [ ! "$2" = "" ] && [ ! "$1" = "$2" ]; then iconv -cs -f "$1" -t "$2" 2> /dev/null else - cat # no convert, just output + # else no convert, just output + cat fi } @@ -68,7 +70,8 @@ feed() { tmpencfile="" encoding="$4" if [ ! "$encoding" = "" ]; then - fetchfeed "$2" "$1" "$lastupdated" | convertencoding "$encoding" "utf-8" + fetchfeed "$2" "$1" "$lastupdated" | \ + convertencoding "$encoding" "utf-8" else # detect encoding. tmpencfile=$(mktemp -p "$TMPDIR") fetchfeed "$2" "$1" "$lastupdated" > "$tmpencfile"