about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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() {