scripts for my gemini capsule
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
if [ "$QUERY_STRING" = "" ]
then
	printf "10 Enter a ccel author/workname \r\n"
	return
fi

hasslash=$(echo "$QUERY_STRING"|grep '/')
if [ "$hasslash" = "" ]
then
 printf "31 /cgi-bin/ccelauthor.sh?$QUERY_STRING\r\n"
 exit 0
fi
printf "20 text/gemini\r\n"

printf "=> %s This page was automatically generated from the following CCEL book (http)\n" https://ccel.org/ccel/"$QUERY_STRING"
printf "=> /thml2gmi/ and converted with thml2gmi\n"
curl -s https://ccel.org/ccel/"$QUERY_STRING".xml | ./thml2gmi.py /dev/stdin