summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2019-04-20 16:37:32 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2019-04-20 16:37:32 +0200
commit57635defdb885926135a920105c87d4704bb4acb (patch)
tree1de2fcd164b9f9884547dedc7294b38996a649b5 /README
parent493e2e508530aa95d4806e4aca52183794d20ad0 (diff)
README: add sfeed_atom aggregate feed example
Diffstat (limited to 'README')
-rw-r--r--README22
1 files changed, 22 insertions, 0 deletions
diff --git a/README b/README
index 08c755d..a05295c 100644
--- a/README
+++ b/README
@@ -304,6 +304,28 @@ fetch() {
- - -
+Aggregate feeds. This filters new entries (maximum one day old) and sorts them
+by newest first. Prefix the feed name in the title. Convert the TSV output data
+to an Atom XML feed (again):
+
+#!/bin/sh
+cd ~/.sfeed/feeds/ || exit 1
+
+LC_ALL=C awk -F ' ' -v "old=$(($(date -j +'%s') - 86400))" '
+BEGIN {
+ OFS = "\t";
+}
+{
+ if (int($1) >= old) {
+ $2 = "[" FILENAME "] " $2;
+ print $0;
+ }
+}' * | \
+sort -k1,1rn | \
+sfeed_atom
+
+- - -
+
Over time your feeds file might become quite big. You can archive items from a
specific date by doing for example: