Implemented date subtitles.

This commit is contained in:
Emilis Dambauskas 2020-11-20 03:00:17 +02:00
parent a55d5b085a
commit 31fdfe805b
1 changed files with 19 additions and 2 deletions

View File

@ -1,3 +1,4 @@
NUM_LINKS_TO_SHOW= 50
PARALLEL_DOWNLOADS= 8
@ -20,11 +21,27 @@ index.gmi: \
sorted.gmi \
footer.gmi \
cat $+ > "$@"
> "$@"
cat header.gmi > "$@"
awk '\
BEGIN { \
D=""; \
T=""; \
} { \
if(D!=substr($$3, 0, 10)) { \
D=substr($$3, 0, 10); \
T="## "D"\n"; \
printf "%s", T; \
} \
$$3=""; \
print \
}' sorted.gmi \
| tee -a "$@"
cat footer.gmi >> "$@"
sorted.gmi: downloaded.gmi
cat "$<" | sort -k 3 -r | uniq | head -100 > "$@"
cat "$<" | sort -k 3 -r | uniq | head -${NUM_LINKS_TO_SHOW} > "$@"
downloaded.gmi: feeds.txt