Honestly, I want to know how you people make guestbooks on here. I want to get into scripting to make my sites more interesting, but don't know where to start.
2 years ago ยท ๐ jo, gritty, anthrax, alexlehm
I have started cgi-bin with Gemini using PHP recently and I have written a very small feedback script, a guestbook would be easy as well ยท 2 years ago
Gemini://tilde.team/~tomasino/journal/20220308-how-to-build-a-gemini-application.gmi ยท 2 years ago
Gemini://tilde.team/~tomasino/journal/20220308-how-to-build-a-gemini-application.gmi
oh dont forget the # before the first line ofc, idk why it threw that out ยท 2 years ago
!/bin/bash
guestbookfile=/path/to/file
address=gemini://redirect.address
decode_percent_encoding(){
echo "$1" | sed 's@+@ @g;s@%@\\x@g' | xargs -0 printf "%b"
}
if [[ "$QUERY_STRING" != "" ]]; then
message=$(decode_percent_encoding "$QUERY_STRING")
sed -i.bak -e "/โ sign/a>\"$message\"\n- at $(date +'%H:%M on %d.%m.%Y')\n
" "$guestbookfile" #replace 'โ sign' with the line you wanna start the guestbook under
printf "30 $address\r\n" #redirect link
else
printf "10 leave a message\r\n" #input field
fi ยท 2 years ago
oh i can help with that! i asked pretty much the same question on here a few months ago and its actually really not that hard. for a guestbook script youll need a capsule with cgi-support, i'm not sure how this works on yesterweb sadly but i can comment the script to my own, very basic guestbook hold on ยท 2 years ago