scripts for my gemini capsule
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
if [ "$QUERY_STRING" = "q" ]
then
	printf "10 Enter a ccel author \r\n"
	return
fi
if (echo "$QUERY_STRING" | grep '?'>/dev/null)
then
    prefix="$(echo "$QUERY_STRING"|cut -d '?' -f1)"
    # Permanent redirect. These URLs should never have been made.
    printf "31 ccelauthor.sh?$prefix\r\n"
    return
fi
printf "20 text/gemini\r\n"
curl -q https://ccel.org/index/author 2>/dev/null|grep "/$QUERY_STRING/" | sed 's@ccel/@\t@g' |sed 's/"/\t/g' |cut -f3 | sed 's/^/=> ccel.sh?/g'