#!/bin/sh
printf "20 text/gemini\r\n"
cat <<EOF
back to main indexWhile this is an aggregated gemlog for all users, this does not imply that it is also a list of all posts. For one thing, this aggregated gemlog only includes links that follow the gemini companion specification for subscribing to text/gemini pages. For another, it only includes links found in one of only a few prominent entry points that are suspected of containing gemlogs (such as the main index.gmi file of a capsule or a file called gemlog.gmi, for example). If you are a tilde.club user and your gemlog is not included in the list, please feel free to request its inclusion by sending an email to seifferth@tilde.club.
EOF
get() {
grep -P \
'^=>[ \t]+[^ \t]+[ \t]+[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]' \
-s "$@" |
sed 's,\r,,g;s,\t, ,g;s, *$,,
s,^/home/,,
#
s,\([^/]\+\)/public_gemini/[^:]*:=> *\([a-z]\+://\),\1\t\2,
s,\([^/]\+\)/public_gemini/[^:]*:=> */,\1\t/,
s,\([^/]\+\)/public_gemini/\([^:]*/\)\?[^:]*:=> *,\1\t/~\1/\2,
s,^\([^\t]\+\)\t\(.*\)$,\2\t\1,
s,^\([^ ]*\) \+\([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\)[ :-]*,\2\t\1 \2 ,'
}
( get \
/home/*/public_gemini/index.gmi \
/home/*/public_gemini/gemlog.gmi \
/home/*/public_gemini/blog.gmi \
/home/*/public_gemini/gemlog/index.gmi \
/home/*/public_gemini/gemlog/all.gmi \
/home/*/public_gemini/blog/index.gmi \
/home/*/public_gemini/blog/all.gmi \
/home/*/public_gemini/text/gemlog.gmi \
/home/*/public_gemini/journal/index.gmi \
/home/*/public_gemini/log/index.gmi
) | sort -r | uniq | sed 's,^[^\t]\+\t,,;s,^\(.*\)\t\([^\t]*\)$,=> \1 (by ~\2),'