diff options
Diffstat (limited to 'sfeed_update')
-rwxr-xr-x | sfeed_update | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sfeed_update b/sfeed_update index 2977bdc..5e265a7 100755 --- a/sfeed_update +++ b/sfeed_update @@ -31,14 +31,10 @@ loadconfig() { # merge raw files. # merge(oldfile, newfile) merge() { - # unique check by id, title, link. - # print only new entries in newfile. - # order new items by timestamp (asc). - (sed 's@^@O @' "$1" - sed 's@^@N @' "$2") | \ - LC_ALL=C awk '!x[$7 " " $3 " " $4]++ && $1 == "N"' 2>/dev/null | \ - cut -f 2- | \ - sort -t ' ' -k1n,1 + # unique sort by id, title, link. + # order by timestamp (desc). + (sort -t ' ' -u -k6,6 -k2,2 -k3,3 "$1" "$2" 2>/dev/null) | + sort -t ' ' -k1rn,1 } # fetch a feed via HTTP/HTTPS etc. |