💾 Archived View for station.martinrue.com › drunkpigeon › b8c15f8dab894b5ba77b47241972b7d0 captured on 2023-04-20 at 01:36:00. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-03-20)

➡️ Next capture (2023-05-24)

🚧 View Differences

-=-=-=-=-=-=-

👽 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.

1 month 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 · 1 month ago

👽 gritty

Gemini://tilde.team/~tomasino/journal/20220308-how-to-build-a-gemini-application.gmi · 1 month ago

👽 jo

oh dont forget the # before the first line ofc, idk why it threw that out · 1 month 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 · 1 month 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 · 1 month ago