about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2022-07-20 12:07:34 -0500
committerCase Duckworth2022-07-20 12:07:34 -0500
commit126e78123d48733f42bb6b2e367773183bb80922 (patch)
tree2bb4358f622b18eedfdba7409694f97006244a35
parentFix twtxt (diff)
downloadsfeed-126e78123d48733f42bb6b2e367773183bb80922.tar.gz
sfeed-126e78123d48733f42bb6b2e367773183bb80922.zip
Order twtxt feeds
-rwxr-xr-xrunsfeed15
1 files changed, 13 insertions, 2 deletions
diff --git a/runsfeed b/runsfeed index 07df1e5..62072d8 100755 --- a/runsfeed +++ b/runsfeed
@@ -50,7 +50,7 @@ main() {
50 mv /tmp/feeds.opml "$SFEED_OUTPUT/feeds.opml"; 50 mv /tmp/feeds.opml "$SFEED_OUTPUT/feeds.opml";
51 }' 51 }'
52 logok "Generating twtxt" '{ 52 logok "Generating twtxt" '{
53 twtxt "$sfeedpath"/* >/tmp/feeds.txt && 53 twtxt "$sfeedpath" >/tmp/feeds.txt &&
54 mv /tmp/feeds.txt "$SFEED_OUTPUT/feeds.txt"; 54 mv /tmp/feeds.txt "$SFEED_OUTPUT/feeds.txt";
55 }' 55 }'
56 # logok "Archiving old feeds" \ 56 # logok "Archiving old feeds" \
@@ -107,7 +107,18 @@ update() {
107} 107}
108 108
109twtxt() { 109twtxt() {
110 sfeed_twtxt "$@" 110 curd="$PWD"
111 cd "$1" || return 1
112 if [ $# -eq 2 ]; then
113 old="$(($(date +%s) - ($2 * 24 * 3600)))"
114 else
115 old=0
116 fi
117 awk -v old="$old" \
118 'BEGIN{FS="\t";OFS="\t";} int($1)>=old{$2="["FILENAME"] "$2;print}' \
119 * |
120 sort -k1,1rn |
121 sfeed_twtxt
111} 122}
112 123
113opml() { 124opml() {