๐Ÿ‘ฝ drunkpigeon

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.

9 months ago ยท ๐Ÿ‘ jo, gritty, anthrax, alexlehm

Actions

๐Ÿ‘‹ Join Station

5 Replies

๐Ÿ‘ฝ 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 ยท 9 months ago

๐Ÿ‘ฝ gritty

Gemini://tilde.team/~tomasino/journal/20220308-how-to-build-a-gemini-application.gmi ยท 9 months ago

๐Ÿ‘ฝ jo

oh dont forget the # before the first line ofc, idk why it threw that out ยท 9 months ago

๐Ÿ‘ฝ jo

!/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 ยท 9 months ago

๐Ÿ‘ฝ jo

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 ยท 9 months ago